# Preliminary Research and Development Codes

### Coding Exercise Used in Scenario 1:

//1) Accelerate motor 1 from start to 15% in 2.5 seconds
celerate(1,0,15,2.5);
//2) motor speed at 15% for 1 second
motorSpeed(1,15);
goFor(1);
//3) brake motor 1
brake(1);
//4)run mototr two from 0 to 27% in 4 secs
celerate(2,0,27,4);
//5) run for 2.7 secs
motorSpeed(2,27);
goFor(2.7);
//6) dece;lerate motor 2 to 15 in 1 sec
celerate(2,27,15,1);
//7) brake motor 2
brake(2);
//8) reverse direction of motor 2
reverse(2);
//9) accelerate both from start to 31 in 2 secs
celerate(4,0,31,2);
//10) run all motors for 35% at 1 sec
motorSpeed(4,35);
goFor(1);
//11 brake motor two motor 1 runs for 3 more secs
brake(2);
motorSpeed(1,35);
goFor(3);
//12 brake all motors for 1 sec
brake(4);
goFor(1);
//13 reverse direction of motor 1
reverse(1);
//14) accelerate motor 1 from 0 to 19 2 secs
celerate(1,0,19,2);
//15) run motor 2 at 35 and motor 1 at 19 2 secs
motorSpeed(2,35);
goFor(2);
motorSpeed(1,19);
goFor(2);
//16) run both for 19% at 2sec
motorSpeed(4,19);
goFor(2);
//17) decelerate from to 0 in 3 secs
celerate(4,19,0,3);
//18)brake all motors
brake(4);
//19) save program

### Coding Exercise Used in Scenario 2:

//1) run all motors at a constant speed of 25% power for 2 seconds
motorSpeed(4,25);
goFor(2);
//2) run all motors at a constant speed of 20% power and, using the
//goToAbsolutePosition function, travel a distance of 12 feet from start
motorSpeed(4,20);
goToAbsoluteePosition(295);
//3) reverse all 4 motors
celerate(4,19,0,3);
brake(4);
//4) Reverse all motors
reverse(4);
// run all motors at a constant speed of 30% power for 1.5 seconds
motorSpeed(4,30);
goFor(1.5);
// brake all motors
brake(4);

### Coding Exercise Used in Data Analysis:

//accelerates all motors from rest to 25% power for 3 seconds
celerate(4,0,25,3);
//all motors go at 25% power for 2 seconds
motorSpeed(4,25);
goFor(2);
//all motors go at 20% power for 2 seconds
motorSpeed(4,20);
goFor(2);
//all motors reverse
reverse(4);
//all motors go for 2 seconds at 25% power
motorSpeed(4,25);
goFor(2);
//all motors brake
brake(4);