/* Matt Klein The purpose of this program is to try to create a robot that will travel in a square This program requires a handyboard with a lego motor plugged in correctly to ports one and two, and a touch sensor in digital port 7 3/5/2004 --Write code 3/6/2004 --Continue writing code --Comment code */ void main() { int n=0;//declare and set the value of n to 0 while (n!=4) //Loop program until n is equal to 4 { motor(1,100) ;// Activates motors 1 motor(2,100) ;// & 2 to full forward sleep(2.) ;// Lets motors run for 2 seconds ao() ;// turn motors off to prepare for turn while (digital(7)==0)// This while loop is used to turn until the button is pressed { motor (1,75) ;// Activate motor 1 to 75% forward motor (2,-75);// and motor 2 at 75% backward } ao() ;//Turns motors off n++ ;//increments n } printf("/n I did it!!");//These lines tell the user beep(); beep(); beep();//that the program is done }