Performance Test 2 Code

//set all motors at constant power 30%.

motorSpeed(4,30);

//run AEV until reaching 258 marks.

goToRelativePosition(258);

//brake all motors.

brake(4);

//reverse all motors.

reverse(4);

//set all motors at constant power 30%.

motorSpeed(4,30);

//run AEV for 1.5 seconds.

goFor(1.5);

//set all motors at constant power 0%.

motorSpeed(4,0);

//wait in front of the gate for 7.5 seconds.

goFor(7.5);

//reverse all motors.

reverse(4);

//set all motors at constant power 33%.

motorSpeed(4,33);

//run AEV for 166 marks more.

goToRelativePosition(166);

//set all motors at constant power 0%.

motorSpeed(4,0);

//run AEV for 50 marks more.

goToRelativePosition(50);

//brake all motors.

brake(4);

//reverse all motors.

reverse(4);

//set all motors at constant power 55%.

motorSpeed(4,55);

//run AEV for 0.5 seconds.

goFor(0.5);

//set all motors at constant power 0%.

motorSpeed(4,0);

//wait in front of the cargo train for 7 seconds.

goFor(7);

//set all motors at constant power 50%.

motorSpeed(4,50);

//run AEV for 7 seconds.

goFor(7);