The first performance test the team was tasked with was to create a code for the team AEV that would allow the AEV to travel towards the gate, wait seven seconds at the gate until it is raised up, and proceed through the gate. The team created the following code for this test.
Performance Test 1
celerate(4,0,40,2); //accelerate all motors from 0% to 40% power in 2 seconds.
goToRelativePosition(139); //power the motors until the AEV has moved 139 marks on the trackĀ relative to current position
reverse(4); //reverse all motors
goFor(1); //power motors for 1 secondĀ
celerate(4,40,0,2); //decelerate all motors from 40% to 0% power in 2 seconds
goFor(7); //have the AEV wait for 7 seconds at the gate
reverse(4); //reverse all motors
celerate(4,0,30,2); //accelerate all motors from 0% to 30% power in 2 seconds to pass through the gate
goToRelativePosition(10); //powr the motors until the AEV has moved 10 marks on the track relative to current position