Lab 6

Code:

 

// Reverse the motors.

reverse(4);

 

// Run all motors at a constant speed of 25% power for 2 seconds.

motorSpeed(4,25);

goFor(2);

 

// Run all motors at a constant speed of 20%, travel 13.5 feet.

motorSpeed(4,20);

goToAbsolutePosition(328);

 

// Reverse the motors.

reverse(4);

 

// Run all motors at a constant speed of 30% power for 1 second.

motorSpeed(4,30);

goFor(1);