Code for Lab 4

void myCode()

{

 //—————————————————————————————-

 // myCode();

 //

 // This is the tab where the programming of your vehicle operation is done.

 // Tab _00_AEV_key_words contains a compiled list of functions/subroutines used for vehicle

 // operation.

 //

 // Note:

 // (1) After running your AEV do not turn the AEV off, connect the AEV to a computer, or

 //     push the reset button on the Arduino. There is a 13 second processing period. In

 //     post processing, data is stored and battery recuperation takes place.

 // (2) Time, current, voltage, total marks, position traveled are recorded approximately

 //     every 60 milliseconds. This may vary depending on the vehicles operational tasks.

 //     It takes approximately 35-40 milliseconds for each recording. Thus when programming,

 //     code complexity may not be beneficial.

 // (3) Always comment your code. Debugging will be quicker and easier to do and will

 //     especially aid the instructional team in helping you.

 //—————————————————————————————-

 

 // Program between here——————————————————————-

 

 // exercise 04

 // Accelerate all motors from start to 25% in 3 seconds.

 motorSpeed(4,25);

 goFor(3);

 

// Run all motors at a constant speed (25% power) for 1 second.

 motorSpeed(4,25);

 goFor(1);

 

// Run all motors at 20% power for 2 seconds.

 motorSpeed(4,20);

 goFor(2);

 

// Reverse all motors.

 reverse(4);

 

// Run all motors at a constant speed (25% power) for 2 second.

 motorSpeed(4,40);

 goFor(2);

 

 // Brake all motors.

 brake(4);

 

 // And here——————————————————————————–

 

} // DO NOT REMOVE. end of void myCode()