Codes Utilized

*Note: Every line of code is commented. Comments begin with //. Each comment corresponds to the line(s) of code below it.
Arduino code for Scenario 1 with comments
// Accelerate motor 1 from start to 15% power in 2.5 seconds
celerate(1,0,15,2.5);// Run motor 1 at a constant speed (15%) for 1 second
motorSpeed(1,15);
goFor(1);

// Brake motor 1
brake(1);

// Accelerate motor 2 from start to 27% power in 4 seconds
celerate(2,0,27,4);

// Run motor 2 at a constant speed (27%) for 2.7 seconds
motorSpeed(2,27);
goFor(2.7);

// Decelerate motor 2 to 15% power in 1 second
celerate(2,27,15,1);

// Brake motor 2
brake(2);

// Reverse the direction of only motor 2
reverse(2);

// Accelerate all motors from start to 31% power in 2 seconds
celerate(4,0,31,2);

// Run all motors at a constant speed of 35% power for 1 second
motorSpeed(4,35);
goFor(1);

// Brake motor 2 but keep motor 1 running at a constant speed (35%) for 3 seconds
brake(2);
goFor(3);

// Brake all motors for 1 second
brake(4);
goFor(1);

// Reverse the direction of motor 1
reverse(1);

// Accelerate motor 1 from start to 19% power over 2 seconds
celerate(1,0,19,2);

// Run motor 2 at 35% power while running motor 1 at 19% power for 2 seconds
motorSpeed(2,35);
motorSpeed(1,19);
goFor(2);

// Run both motors at a constant speed (19%) for 2 seconds
motorSpeed(4,19);
goFor(2);

// Decelerate both motors to 0% power in 3 seconds
celerate(4,19,0,3);

// Brake all motors
brake(4);

Code for Reflectance sensor test:

// Run all motors at 25% for 2 seconds.
motorSpeed(4, 25);
goFor(2);

// Run all motors at 20%.
motorSpeed(4, 20);

// Travel a total distance of 12 feet.
goToAbsolutePosition(144/.4875);

// Reverse motors.
reverse(4);

// Run all motors at 30% for 1.5 second.
motorSpeed(4, 30);
goFor(1.5);

// Brake all motors.
brake(4);

Code used for Data Analysis Tool
// Accelerate all motors from 0% to 25% power in 3 seconds
celerate(4,0,25,3);// Run all motors at 25% and stay at this speed for 1 second
motorSpeed(4,25);
goFor(1);

// Change all motors speed to 20% for 2 seconds
motorSpeed(4,20);
goFor(2);

// Reverse direction of all motors
reverse(4);

// Change all motors speed to 25% and stay at this speed for 2 seconds
motorSpeed(4,25);
goFor(2);

// Brake all motors
brake(4);

Code used for Motor Quantity research:
// Accelerate all motors from 0% to 50% power in 3 seconds
celerate(4,0,50,3);// Change all motors speed to 35% and stay at this speed for 1 second
motorSpeed(4, 35);
goFor(1);

// Reverse direction of all motors
reverse(4);

// Change all motors speed to 40% and stay at this speed for 2 seconds
motorSpeed(4, 40);
goFor(2);

// Brake all motors
brake(4);

Code used for Energy Analysis research:
// Initialize all motors speed at 30% and stay at this speed for 4 seconds
motorSpeed(4,30);
goFor(4);// Change all motors speed to 0% and stay at this speed for 10 seconds
motorSpeed(4,0);
goFor(10);

Code for PT1

reverse(4);
celerate(4,0,40.6,1);
goToAbsolutePosition(-237);
reverse(4);
celerate(4,40.6,28.5,.5);
goFor(.5);
brake(4);
goFor(8);
reverse(4);
motorSpeed(4,30);
goFor(4);
brake(4);

Code 1 for PT2

reverse(4);  
celerate(4,0,40.6,1);
goToAbsolutePosition(-237);
reverse(4);
celerate(4,40.6,28.5,.5);
goFor(.5);
brake(4);
goFor(8);
reverse(4);
motorSpeed(4,30);
goFor(4);
brake(4);

goFor(9);
reverse(4);
motorSpeed(4,44);
goFor(4);

Code 2 for PT2

reverse(4);  
motorSpeed(4,40);
goToAbsolutePosition(217);
reverse(4);
motorSpeed(4,31);
goFor(1);
brake(4);
goFor(9);
reverse(4);
motorSpeed(4,31.4);
goFor(4);
brake(4);
goFor(9);
reverse(4);
motorSpeed(4,44);
goFor(4);

Final PT4 Code

reverse(4);  
celerate(4,0,40,1);
goToAbsolutePosition(-232);
reverse(4);
celerate(4,40.6,28.5,.5);
goFor(.5);
brake(4);
goFor(8);
//
reverse(4);
motorSpeed(4,30);
goFor(4.3);
brake(4);
goFor(10);
//

reverse(4);
celerate(4,0,44,2);
goFor(4.3);
brake(4);
goFor(1.1);
reverse(4);
motorSpeed(4,40);
goFor(1.8);
reverse(4);
brake(4);
goFor(7);
//
celerate(4,0,45,1);
goFor(3);
brake(4);
goFor(4.5);
reverse(4);
motorSpeed(4,40);
goFor(2);