Final Performance Test Run Code for Two-Motor AEV
// Run motor one at a constant speed (23% power) for 2.5 second.
// motorSpeed(1,23);
// goFor(2.5);
// Brake motor one.
// brake(1);
//BEGIN TEST PROGRAM
//Initialize motors, reverse motor 3
motorSpeed(1,0);
motorSpeed(2,0);
//motorSpeed(3,0);
//reverse(3);
// start to gate
reverse(4);
motorSpeed(4,40); // 1. Set motors to 40%
goToRelativePosition(-10);
motorSpeed(4,35); // 2. Set motors to 35% (reduce energy use)
goToRelativePosition(-315); // 3. go -315 marks (reverse direction, 13 feet)
motorSpeed(4,0); // 4. all motors at 0%
goFor(7); // 5. wait for 7 seconds (gate opens)
// gate to load-up
motorSpeed(4,40); // 6. Set motors to 40% (break static friction)
goToRelativePosition(-10);
motorSpeed(4,35);
goToRelativePosition(-320); // 8. go -320 marks (13 feet)
motorSpeed(4,0); // 9. all motors at 0%
goFor(5); // 10. wait for 5 seconds (magnetic hookup)
// load-up to gate
reverse(4); // 11. reverse motor polarity
motorSpeed(4,40); // 12. Set motors to 40% (break static friction)
goToRelativePosition(10);
motorSpeed(4,35); //13. Set motors to 35% (reduce energy use)
goToRelativePosition(270); // 14. go 270 marks (11 feet)
motorSpeed(4,0); // 15. all motors at 0%
goFor(7); // 16. wait for 7 seconds (gate opens)
// gate to end
motorSpeed(4,40); // 17. Set motors to 40% (break static friction)
goToRelativePosition(10);
motorSpeed(4,35);
goToRelativePosition(290); // 19. go 290 marks (12 feet)
motorSpeed(4,0); // 20. all motors at 0%
reverse(4); // 21. set motors to original polarity