PR&D Exercise 4

For the code used in this exercise we ran the motors for the first 3.5 seconds. The first 1.4 meters of the power vs distance chart represents the first 3.5 seconds where there was power being used and distance being traveled. The region after that represents the distance traveled while coasting and there was no power being used.

 

 

motorSpeed(4,30);

//Turn both motors to 30% power

goFor(3.5);

//Go for 3.5 seconds

motorSpeed(4,0);

//Turn motors off