/* program to turn robot in both clock and anticlockwise direction white area reflect more light (hence higher reading) However, action not smooth */ task main() { while (true) { SetSensor (SENSOR_2, SENSOR_LIGHT); // light sensor attached to 2) OnFwd (OUT_A+OUT_C);Wait (10); while (true) { if (SENSOR_2 >40) //might want to change the number 40 { //depending on ambient light OnRev(OUT_C); until (SENSOR_2 <=40); OnFwd (OUT_A+OUT_C); Wait (10); } else { OnRev (OUT_A); until (SENSOR_2 >=40); OnFwd (OUT_A+OUT_C); Wait (10); } } } }