Professional Documents
Culture Documents
Fix
Fix
#define
#define
#define
#define
OnFwd(OUT_AC, 20);
Wait(timef1);
Off(OUT_AC);
break;
}
else
{
//failed
TextOut(20, LCD_LINE3, "Lockdown failed!");
break;
}
}
}
task check_dist()
{
while(true)
{
if(SensorUS(IN_4) <= NEAR)
{
TextOut(20, LCD_LINE3, "near");
ClearSensor(IN_4);
nearFlag = 1;
}
else
{
nearFlag=0;
}
}
}
task main()
{
//The interfaces of motors
//A:left B:middle C:right
//The interfaces of sensors
//IN_1:TOUCH IN_2: Color IN_3:
IN_4:Ultrasonic