Scenario 1 Code:
motorSpeed(1,1); // initializes motor 1 at 1% power
celerate(1,1,15,2.5): // accelerates motor 1 from 1% to 15% power in 2.5 seconds
goFor(1);// runs motor 1 at 15% for 1 second
brake(1);// brakes motor 1
motorSpeed(2,1); // initializes motor 2 at 1% power
celerate(2,1,27,4);// accelerates motor 2 from 1% to 27% power in 4 seconds
goFor(2.7); // runs motor 2 at 27% power for 2.7 seconds
celerate(2,27,15,1); // decelerates motor 2 from 27% to 15% power in 1 second
brake(2);//brakes motor 2
reverse(2);// reverses motor 2
motorSpeed(1,1);// initializes motor 1 at 1% power
motorSpeed(2,1);// initializes motor 2 at 1% power
celerate(1,1,31,2);// accelerates motor 1 from 1% to 32% in 2 seconds
celerate(2,1,31,2);// accelerates motor 2 from 1% to 32% in 2 seconds
motorSpeed(1,35);// sets motor 1 to 35% power
motorSpeed(2,35);// sets motor 2 to 35% power
goFor(1);// runs motor 1 and motor 2 at 35% power for 1 second
brake(2);//brakes motor 2
goFor(3);// runs motor 1 at 35% power for 3 seconds
brake(1);// brakes motor 1
reverse(1);//reverses motor 1
motorSpeed(1,1);//initializes motor 1 at 1% power
celerate(1,1,19,2);//accelerates motor 1 from 1% to 19% power in 2 seconds
motorSpeed(2,35);// initializes motor 2 to 35% power
goFor(2);// runs motor 1 at 19% power and motor 2 at 35% power for 2 seconds
motorSpeed(2,19);// sets motor 2 to 19% power
goFor(2);// runs both motors at 19% power for 2 seconds
celerate(1,19,0,3);//decelerates motor 1 from 19% to 0% power in 3 seconds
celerate(2,19,0,3);// decelerates motor 2 from 19% to 0% power in 3 seconds
brake(1);//brakes motor 1
brake(2);// brakes motor 2
2 Wing Config Test:
reverse(1);//reverse motor 1
reverse(2);//reverse motor 2
motorSpeed(1,30);// initialize motor 1 to 30% power
motorSpeed(2,30);//initialize motor 2 to 30%
goToAbsolutePosition(123);//runs the motor until the AEV reaches 123 marks from the start
brake(1);//brake motor 1
brake(2);//brake motor 2
reverse(1);//reverse motor 1
reverse(2);//reverse motor 2
motorSpeed(1,30);//initialize motor 1 to 30% power
motorSpeed(2,30);//initialize motor 2 to 30% power
goToAbsolutePosition(15);//runs the motor until the AEV reaches 15 marks from the start
brake(1);//brake motor 1
brake(2);//brake motor 2
1 Wing Config Test:
reverse(1);//reverse motor 1
motorSpeed(1,30);//initializes motor 1 to 30% power
goToAbsolutePosition(123);//runs the motor until the AEV reaches 123 marks from the start
brake(1);//brake motor 1
reverse(1);//reverse motor 1
motorSpeed(1,30);//initialize motor 1 to 30% power
goToAbsolutePosition(40);//runs the motor until the AEV reaches 40 marks from the start
brake(1);//brake motor 1
Coasting Test Code:
reverse(1);//reverse motor 1
motorSpeed(1,30);//initialize motor 1 to 30% power
goToAbsolutePosition(123);//runs the motor until the AEV reaches 123 marks from the start
brake(1);//brake motor 1
Power Breaking Test Code:
reverse(1);//reverse motor 1
motorSpeed(1,40);//initializes motor 1 to 40% power
goToAbsolutePosition(155);//runs the motor until the AEV reaches 155 marks from the start
brake(1);//brake motor 1
reverse(1);//reverse motor 1
motorSpeed(1,40);//initializes motor 1 to 40% power
goFor(2);//runs the motor for 2 seconds
brake(1);//brake motor 1
Performance Test 1:
reverse(1);//reverses motor 1
motorSpeed(1,55);//initializes motor 1 to 55% power
goToAbsolutePosition(157);//runs the motor until the AEV reaches the point 157 marks from where it began
brake(1);//brakes motor 1
goToAbsolutePosition(268);//runs the motor until the AEV reaches the point 268 marks from where it began
rotateServo(49);//rotates the servo 49 degress
goFor(5);//continues for 5 seconds
rotateServo(-49);//rotates the servo -49 degrees
goFor(3.5);//continues for 3.5 seconds
motorSpeed(1,50);////initializes motor 1 to 50% power
goToRelativePosition(80);//runs the motor until the AEV reaches the point 80 marks from where it is currently
brake(1);//brakes motor 1
Perfromance Test 2:
reverse(1);//reverses motor 1
motorSpeed(1,55);//initializes motor 1 to 55% power
goToAbsolutePosition(157);//runs the motor until the AEV reaches the point 157 marks from where it began
brake(1);//brakes motor 1
goToAbsolutePosition(268);//runs the motor until the AEV reaches the point 268 marks from where it began
rotateServo(49);//rotates the servo 49 degress
goFor(5);//continues for 5 seconds
rotateServo(-49);//rotates the servo -49 degrees
goFor(3.5);//continues for 3.5 seconds
motorSpeed(1,50);////initializes motor 1 to 50% power
goToRelativePosition(80);//runs the motor until the AEV reaches the point 80 marks from where it is currently
brake(1);//brakes motor 1
goToRelativePosition(211);//runs the motor until the AEV reaches the point 211 marks from where it is currently
rotateServo(50);//rotates the servo 50 degress
goFor(4);//continues for 4 seconds
rotateServo(-50);//rotates the servo -50 degrees
goFor(2);//continues for 2 seconds
Final Performance Test / Full Code:
reverse(1);//reverses motor 1
motorSpeed(1,55);//initializes motor 1 to 55% power
goToAbsolutePosition(157);//runs the motor until the AEV reaches the point 157 marks from where it began
brake(1);//brakes motor 1
goToAbsolutePosition(268);//runs the motor until the AEV reaches the point 268 marks from where it began
rotateServo(49);//rotates the servo 49 degress
goFor(5);//continues for 5 seconds
rotateServo(-49);//rotates the servo -49 degrees
goFor(3.5);//continues for 3.5 seconds
motorSpeed(1,50);////initializes motor 1 to 50% power
goToRelativePosition(80);//runs the motor until the AEV reaches the point 80 marks from where it is currently
brake(1);//brakes motor 1
goToRelativePosition(211);//runs the motor until the AEV reaches the point 211 marks from where it is currently
rotateServo(50);//rotates the servo 50 degress
goFor(4);//continues for 4 seconds
rotateServo(-50);//rotates the servo -50 degrees
goFor(2);//continues for 2 seconds
reverse(1);//reverses motor 1
motorSpeed(1,60);//initializes motor 1 to 60% power
goToRelativePosition(-184);//runs the motor until the AEV reaches the point -184 marks from where it is currently
brake(1);//brakes motor 1
goToRelativePosition(-4);//runs the motor until the AEV reaches the point -4 marks from where it is currently
rotateServo(50);//rotates the servo 50 degrees
goFor(5);//continues for 5 seconds
rotateServo(-50);//rotates the servo -50 degrees
goFor(4);//continues for 4 seconds
motorSpeed(1,60);//intializes motor 1 to 60% power
goToRelativePosition(-90);//runs the motor until the AEV reaches the point -90 marks from where it is currently
brake(1);//brakes motor 1
goToRelativePosition(-80);//runs the motor until the AEV reaches the point -80 marks from where it is currently
rotateServo(51);//rotates the servo 51 degrees
goFor(4);//continues for 4 seconds
rotateServo(-51);//rotates the servo -51 degrees
goFor(2);//continues for 2 seconds
<–AEV Designs Final Results and Pitch–>