B. Advanced R&D

Servo Calibration and Use

Test without servo
//Run all motors at a constant speed of 25% power for 2 seconds.
motorSpeed(4,25);
goFor(2);
//Brake all motors.
brake(4);
Test with servo
//Run all motors at a constant speed of 25% power for 2 seconds.
motorSpeed(4,25);
goFor(2);
//Brake all motors for 7 seconds.
brake(4);
rotateServo(90);
Code for Pull and Push
//Code for Pull
//Run all motors at a constant speed of 25% power for 3 seconds.
motorSpeed(4,25);
goFor(3);
//Brake all motors.
brake(4);
//Code for Push
//Reverse all motors.
reverse(4);
//Run all motors at a constant speed of 25% power for 3 seconds.
motorSpeed(4,25);
goFor(3);
//Brake all motors.
brake(4);
Code for Power Usage with Attached Caboose
//RUN 1
//reverse all motors.
reverse(4);
//Run all motors at a constant speed of 34% power for 4 sceonds.
motorSpeed(4,34);
goFor(4);
//Brake all motors.
brake(4);
//RUN 2
//reverse all motors.
reverse(4);
//Run all motors at a constant speed of 37% power for 4 sceonds.
motorSpeed(4,37);
goFor(4);
//Brake all motors.
brake(4);
//RUN 3
//reverse all motors.
reverse(4);
//Run all motors at a constant speed of 40% power for 4 sceonds.
motorSpeed(4,40);
goFor(4);
//Brake all motors.
brake(4);
//RUN 4
//reverse all motors.
reverse(4);
//Run all motors at a constant speed of 43% power for 4 sceonds.
motorSpeed(4,43);
goFor(4);
//Brake all motors.
brake(4);