-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSUMOEYES.bak
55 lines (47 loc) · 1.5 KB
/
SUMOEYES.bak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "SE-lib.nxc"
#define battle 25
task main()
{
int ob;
string x,y;
SetSensorLowspeed(S4);
SetSensorLowspeed(S2);
while(true)
{
SumoEyes_SetLongRange(S3);
SumoEyes_SetShortRange(S3);
ob=SumoEyes_DetectObstacleZone(S3);
x = SE_OBZoneToString(ob);
ob = SumoEyes_DetectObstacleZone(S3);
y = SE_OBZoneToString(ob);
NumOut(0,LCD_LINE3,SensorUS(S4),true);
OnFwdSync(OUT_BC,-50,0);
TextOut(0,LCD_LINE1, x);
TextOut(0,LCD_LINE2, y);
if(SensorUS(S4) || SensorUS(S2)<25)
{
OnFwdSync(OUT_BC,-20,0);
}
if(x=="FRONT")
{
Off(OUT_BC);
//OnFwdSync(OUT_BC,-50,100);
do
{
ob=SumoEyes_DetectObstacleZone(S3);
x = SE_OBZoneToString(ob);
OnFwdSync(OUT_BC,-20,100);
}
while(x=="FRONT")
OnFwdSync(OUT_BC,-40,0);
Wait(700);
Off(OUT_BC);
Wait(200);
Off(OUT_B);
OnFwd(OUT_C,-20);
Wait(500);
//RotateMotorEx(OUT_BC, -50, 90, 50, true, true);
//PlayTone(5000,30);
}
}
}