Lab 4 Arduino Code

reverse(4);                                                 //Reverses the polarity of all motors.

motorSpeed(4,25);                                  //Initializes all motors at 25 percent power.

goFor(2);                                                   //Execute previous command for 2 seconds.

motorSpeed(4,20);                                 //Initializes all motors at 20 percent power.

goToAbsolutePosition(332);                //Run all motors at a constant speed of 20% and using the goToAbsolutePosition function travel a total distance of 13.5 feet (from the starting point).

reverse(4);                                                //Reverses the polarity of all motors.

motorSpeed(4,30);                                 //Initializes all motors at 30 percent power.

goFor(1);                                                   //Execute previous command for 1 second.

brake(4);                                                   //Remove power from all motors.