Lab 8

Comments: The use of the servo motor has been implemented at this point and the code for the mission has been completed

// Reverse motors.

reverse(4);
// Run all motors at a constant speed of 47%, travel to first gate.
motorSpeed(4,47);
goToAbsolutePosition(100);
// Cut power to glide into gate.
motorSpeed(4,0);
goToAbsolutePosition(372);
// Use servo to brake AEV.
rotateServo(30);
brake(4);
goFor(7.5);
rotateServo(-30);
// Run all motors at a constant speed of 47%, travel into loading station.
motorSpeed(4,47);
goToAbsolutePosition(500);
// Cut poewr to glide into loading station.
motorSpeed(4,0);
goToAbsolutePosition(760);
// Reverse motors and glide slowly into loading station.
reverse(4);
motorSpeed(4.28);
goFor(1.5);
// Brake motors and wait at loading staiton.
brake(4);
goFor(6);
// Run all motors at a constant speed of 70 and travel back to gate.
motorSpeed(4,70);
goToAbsolutePosition(650);
// Cut power to glide into gate.
motorSpeed(4,0);
goToAbsolutePosition(436);
// Use servo to brake AEV.
rotateServo(30);
brake(4);
goFor(7.5);
rotateServo(-30);
// Run all motors at a constant speed of 70%, travel back to rebel camp.
motorSpeed(4,70);
goToAbsolutePosition(250);
// Cut power to glide into camp.
motorSpeed(4,0);
goToAbsolutePosition(15);
// Use servo to brake AEV.
rotateServo(30);
brake(4);