RUN 1 4/14
reverse(4);
//motors are reverse for polarity
motorSpeed(4,30);
goToAbsolutePosition(230);
motorSpeed(4,20);
//motor speed slows down in the middle before reaching the gate to achieve a consistent stop
goToRelativePosition(245);
reverse(4);
//motors reverse to stop quickly
motorSpeed(4,65);
goFor(.5);
brake(4);
//motors stop completely
motorSpeed(4,0);
goFor(10);
//AEV reaches the gate and pauses
reverse(4);
//motors reverse again for polarity
motorSpeed(4,30);
goToRelativePosition(465);
reverse(4);
//motors reverse to brake and coast before reaching the R2D2
motorSpeed(4,65);
goFor(.5);
brake(4);
//motors are completely off and the AEV coasts
motorSpeed(4,0);
goFor(8);
//time it takes to pick up the R2D2
motorSpeed(4,50);
goToRelativePosition(-232);
//since the AEV is going backwards, the relative position is negative
motorSpeed(4,40);
//motors slow down to achieve a consistent stop
goToRelativePosition(-175);
reverse(4);
//motors reverse to brake
motorSpeed(4,90);
goFor(.75);
brake(4);
motorSpeed(4,0);
goFor(12);
//AEV is waiting at the gate
reverse(4);
//motors reverse for the polarity
motorSpeed(4,50);
goToRelativePosition(-180);
motorSpeed(4,40);
//motor speed decreases to achieve a consistent stop
goToRelativePosition(-204);
reverse(4);
//motors reverse to brake
motorSpeed(4,70);
goFor(.85);
brake(4);
//motors are completely off and the AEV coasts for a little bit