Program used for the Program Basics lab in the Preliminary R&D:
celerate(1,0,15,2.5); | // Accelerate motor 1 from 0% to 15% power in 2.5 seconds |
motorSpeed(1,15); goFor(1); |
// Constant Speed at 15% power for 1 second |
brake(1); | // Cut power to motor 1 |
celerate(2,0,27,4); | // Accelerate motor 2 from 0% to 27% power in 4 seconds |
celerate(2,27,15,1); | // Decellerate motor 2 from 27% to 15% power in 1 second |
brake(2); | // Cut power to motor 2 |
reverse(2); | // Reverse motor 2 |
celerate(4,0,31,2); | // Accelerate both motors from 0% to 31% power in 2 seconds |
motorSpeed(4,35); goFor(1); |
// Both motors run at 35% power for 1 second |
brake(2); motorSpeed(1,35); goFor(3); |
// Cut motor 2 power, 1 keeps going at 35% for 3 seconds |
brake(4); goFor(1); |
// Cut power to both motors for 1 second |
reverse(1); | // Reverse motor 1 |
celerate(1,0,19,2); | // Accelerate motor 1 from 0% to 19% for 2 seconds |
motorSpeed(2, 35); motorSpeed(1, 19); goFor(2); |
// Run motor 2 at 35% and 1 at 19% for 2 seconds |
motorSpeed(4, 19); goFor(2); |
// Both at 19% for 2 seconds |
celerate(4,19,0,3); | // Decelerate both motors from 19% to 0% power in 3 seconds |
brake(4); | // Cut power to both motors |
Program used for the External Sensors lab in the Preliminary R&D:
motorSpeed(4,25); goFor(2); |
// Both motors run at 25% power for 2 seconds |
motorSpeed(4,20); goToAbsolutePosition(295); |
// Both motors run at 20% power and travel 12 ft |
reverse(4); | // Reverse both motors |
motorSpeed(4,30); goFor(1.5); |
// Both motors run at 30% power for 1.5 seconds |
brake(4); | // Cut power to both motors |
Program used for the Design Analysis Tool lab in the Preliminary R&D:
reverse(4); | // Reverse both motors |
celerate(4,0,25,3); | // Accelerate both motors from 0% to 25% power in 3 seconds |
motorSpeed(4,25); goFor(1); |
// Run both motors at 25% power for 1 second |
motorSpeed(4,20); goFor(2); |
// Run both motors at 20% power for 2 seconds |
reverse(4); | // Reverse both motors |
motorSpeed(4,25); goFor(2); |
// Run both motors at 25% power for 2 seconds |
brake(4); | // Cut power to both motors |