Lab 5 Code

Code:                          Comments:

reverse(4);                                       //reserve all motors
motorSpeed(4,50);                        //set all motors to 50% power
goToAbsolutePosition(180);       //run the AEV until it travels 180 marks
motorSpeed(4,35);                       //set all motors to 35%
goToAbsolutePosition(360);      //go to an absolute position of 360 marks
reverse(4);                                      //reverse all motors
motorSpeed(4,75);                       //set all motors to 75% power
goFor(1.4);                                    //run for 1.4 seconds
brake(4);                                       //brake all motors
goFor(3);                                      //brake for 3 seconds
reverse(4);                                   //reverse all motors
motorSpeed(4,50);                    //set all motors to 50% power
goToRelativePosition(180);     //run the AEV and additional 180 marks forward
motorSpeed(4,35);                    //set all motors to 35% speed
goToRelativePosition(170);     //have the AEV go forward another 170 marks
reverse(4);                                   //reverse all motors
motorSpeed(4,75);                    //set all motors to 75% power
goFor(1.4);                                  //run the motors for 1.4 seconds