D. Performance Test 2

//Run all motors at a constant speed of 33% power.
motorSpeed(4,33);
//Using the goToAbsolutePosition function travel a total distance of 230 marks (from the starting point)
goToAbsolutePosition(230);
//Run all motors at a constant speed of 10% power.
motorSpeed(4,10);
//Using the goToAbsolutePosition function travel a total distance of 291 marks (from the starting point)
goToAbsolutePosition(291);
//Brake all motors for 7 seconds.
brake(4);
for(pos=10; pos<=70; pos+=10)
{
rotateServo(pos);
delay(30);
}
rotateServo(76);
goFor(8);
//Run all motors at a constant speed of 25% power.
rotateServo(20);
motorSpeed(4,25);
//Using the goToAbsolutePosition function travel a total distance of 500 marks (from the starting point)
goToAbsolutePosition(500);
//Run all motors at a constant speed of 10% power.
motorSpeed(4,10);
//Using the goToAbsolutePosition function travel a total distance of 600 marks (from the starting point)
goToAbsolutePosition(600);
//Run all motors at a constant speed of 5% power.
motorSpeed(4,5);
//Using the goToAbsolutePosition function travel a total distance of 624 marks (from the starting point)
goToAbsolutePosition(624);
//Brake all motors for 5 seconds.
brake(4);
for(pos=10; pos<=70; pos+=10)
{
rotateServo(pos);
delay(30);
}
rotateServo(76);
goFor(6);
//rotate servo to 0 degree and reverse all motors
rotateServo(0);
reverse(4);
//Run all motors at a constant speed of 35% power for 4 sceonds.
motorSpeed(4,35);
goFor(4);
//Brake all motors.
brake(4);
for(pos=10; pos<=70; pos+=10)
{
rotateServo(pos);
delay(30);
}
rotateServo(76);