also it's supposed to stay within a one square meter radius, or 14ft2 approximately, so i think we've made some progress but it's a bit hard.
Code: Select all
task check_sensors()
{
while (true)
{
if (SENSOR_1 == 1)
{
#define THRESHOLD 40
task main(){
SetSensorLowspeed(IN_1);
SetSensorLight(IN_2);
OnFwd(OUT_AC, 75);
while(true){
if (Sensor(IN_2) > THRESHOLD){
OnRev(OUT_C, 75);
Wait(100);
until(Sensor(IN_2) <= THRESHOLD);
OnFwd(OUT_AC, 75);
}
}
}
#define NEAR 15 // cm
task main(){
SetSensorLowspeed(IN_1);
while(true){
OnFwd(OUT_AC, 50);
while(SensorUS(IN_1)>NEAR);
OnRev(OUT_C, 100);
Wait(800);
}
Line 10: Error: ';' expected
Line 10: Error: Undifined Identifier main
Line 10: Error: '=' expected
Line 10: Error: Math Factor expected
Line 26: Error: ';' expected
Line 26: Error: Undifined Identifier main
Line 26: Error ''=' expected
Line 26: Error: Math Factor expected
Line 36: Error: '}' expected
Line 37: Error: '}' expected
Line 38: Error: No task named "main" exists