Performance Test 1

int m = getBackwardCounts(); int n = getForwardCounts(); // Initialize the position variables.
motorSpeed(4,-50); // Start the AEV moving quickly.
pauseFor(.55); // Allow the AEV to move quickly for a short time before lowering the speed.
motorSpeed(4,-33); // Slow the motors.
m = getBackwardCounts(); n = getForwardCounts(); // Reset the position variables
while(n – m < 300) // Continue the motor until the AEV reaches 300 counts (12.2 feet) from start to give it time to stop.
{
n = getForwardCounts(); // Check the current location.
m = getBackwardCounts(); // Check the current location.
}
motorSpeed(4,0); // Stop the motor.
rotateServo(50); // Apply the brake.
pauseFor(7); // Give the gate time to open.
rotateServo(0); // Release the brake.
motorSpeed(4,-33); // Start the AEV
m = getBackwardCounts(); n = getForwardCounts(); // Acquire current location.
while(n – m < 500) // Continue the motor until the AEV reaches 500 counts (20.3 feet) from start to give it time to stop.
{
n = getForwardCounts(); // Check the current location.
m = getBackwardCounts(); // Check the current location.
}
motorSpeed(4,0); // Stop the motor.
rotateServo(50); // Apply the brake.