Lab 10 Energy Optimization Day 3 Code

Got the additional vehicle and stopped at the gate on the way back in a different room

reverse(4); //Reverse the Polarization of both motors

 motorSpeed(4,35); //set motor speed of both motors to 35

 goFor(1); //goes at that motor speed for 1 second

 motorSpeed(4,25); //set motor speed of both motors to 25

 goToAbsolutePosition(425); //sets the distance to run the motors for to 425 marks of absolute position

 brake(4); //cuts power to all 2 motors

 reverse(4); //Reverse the Polarization of both motors

 motorSpeed(4,20); //set motor speed of both motors to 20

 goFor(2); //goes at that motor speed for 2 seconds

 brake(4); //cuts power to all 2 motors

 goFor(8); //goes at that motor speed for 8 seconds

 reverse(4); //Reverse the Polarization of both motors

 

 motorSpeed(4,35); //set motor speed of both motors to 35

 goFor(1); //goes at that motor speed for 1 second

 motorSpeed(4,25); //set motor speed of both motors to 25

 goToRelativePosition(400); //sets the distance to run the motors for to 400 marks of current position

 brake(4); //cuts power to all 2 motors

 reverse(4); //Reverse the Polarization of both motors

 motorSpeed(4,20); //set motor speed of both motors to 20

 goFor(1.5); //goes at that motor speed for 1.5 second

 

 brake(4); //cuts power to all 2 motors

 goFor(4); //goes at that motor speed for 4 second

 motorSpeed(4,55); //set motor speed of both motors to 55

 goFor(2); //goes at that motor speed for 2 seconds

 motorSpeed(4,35); //set motor speed of both motors to 35

 goToRelativePosition(-297); //sets the distance to run the motors for to -297 marks of current position

 brake(4); //cuts power to all 2 motors

 reverse(4); //Reverse the Polarization of both motors

 motorSpeed(4,25); //set motor speed of both motors to 25

 goFor(3.5); //goes at that motor speed for 3.5 seconds

 

 brake(4); //cuts power to all 2 motors

 goFor(8); //goes at that motor speed for 8 seconds

 reverse(4); //Reverse the Polarization of both motors

 motorSpeed(4,55); //set motor speed of both motors to 55

 goFor(2); //goes at that motor speed for 2 seconds

 motorSpeed(4,35); //set motor speed of both motors to 35

 goToRelativePosition(-330); //sets the distance to run the motors for to -330 marks of current position

 brake(4); //cuts power to all 2 motors

 reverse(4); //Reverse the Polarization of both motors

 motorSpeed(4,25); //set motor speed of both motors to 25

 goFor(2); //goes at that motor speed for 2 seconds