Week 11 Code

Week 11 Code

Code:

void myCode()

{

reverse(1);

reverse(2);

celerate(4,0,30,2);

motorSpeed(4,30);

goToAbsolutePosition(-245);

brake(1);

brake(2);

reverse(1);

reverse(2);

celerate(4,0,45,3);

brake(1);

brake(2);

reverse(1);

reverse(2);

motorSpeed(4,0);

goFor(6);

celerate(4,0,40,2);

celerate(4,40,30,1);

motorSpeed(4,30);

goToAbsolutePosition(-675);

brake(1);

brake(2);

reverse(1);

reverse(2);

celerate(4,0,40,2);

celerate(4,40,0,1);

motorSpeed(4,0);

goFor(1);

brake(1);

brake(2);

reverse(1);

reverse(2);

reverse(1);

reverse(2);

celerate(4,0,50,2);

celerate(4,50,40,2);

motorSpeed(4,40);

goToRelativePosition(-300);

brake(1);

brake(2);

reverse(1);

reverse(2);

celerate(4,0,55,4);

}

Comments: The AEV Successfully traverses through the gate, comes to a smooth stop, picks up the caboose, successfully returns and passes through the gate, and finally comes to a stop near its starting point. The AEV code is almost complete as the AEV is able to navigate the course, however, the distance at which power is cut the motors on the AEV’s return to the starting will have to be adjusted as the AEV is coming to a final stop before the vehicle’s original starting point.