//Kevin04, Made by Kevin van Rensburg, 21 Feb 2003 //This program makes the robot do the following: //1) Drive out the office //2) Make a square //3) Come back to original position in office. //Made for Kevin's Roverbot 3 //Download to program Slot 1 #define MOVE_TIME 100 //Time for a straight move #define TURN_TIME 66 //Time for 90 degree turn task main() { SetPower(OUT_A+OUT_C,3); //Set Power to 3 OnFwd(OUT_A+OUT_C); //Switch on motors. Wait(300); //Move forward OnRev(OUT_C); //Right turn Wait(TURN_TIME); //90 degrees OnFwd(OUT_A+OUT_C); //Switch on motors. Wait(500); //Move forward OnRev(OUT_A); //Left turn Wait(TURN_TIME); //90 degrees OnFwd(OUT_A+OUT_C); //Switch on motors. Wait(400); //Move forward OnRev(OUT_C); //Right turn Wait(70); //90 degrees OnFwd(OUT_A+OUT_C); //Switch on motors. Wait(1500); //Move forward repeat(4) //make a square { OnFwd(OUT_A+OUT_C); Wait(70); OnRev(OUT_C); Wait(70); } OnRev(OUT_C); //Right turn Wait(140); //180 degrees OnFwd(OUT_A+OUT_C); //Switch on motors. Wait(1500); //Move forward Off(OUT_A+OUT_C); //Turn off Motors }