Aishwarya Srivastava, Steve Saliba, Josh Kloenne
Group K, 4:10 PM, Dr. Bixler
23 – Jan – 2o15
Executive Summary
During the Arduino Programming Basics lab, the team was introduced to the programming aspect of the AEV design process. As the name suggests, the team learnt about the basics of Arduino programming, by studying about the common methods and techniques that could be used. The team also practiced writing the code for a given scenario using the learnt function calls. This code was uploaded to the Arduino controller and tested statically on desktop stands. Figure 1 shows the Arduino board that was attached to the vehicle at the time of testing.
Given below is the code that was built during this lab:
Arduino Program
//Accelerate motor 1 from start to 10% power in 3 s
celerate(1,0,10,3);
//Run motor 1 at 10% power for 1 s
motorSpeed(1,10);
goFor(1);
//Brake motor 1
brake(1)
//Accelerate motor 2 from start to 27% power for 4 s
celerate(2,0,27,4);
//Run motor 2 at 27% power for 3 s
motorSpeed(2,27);
goFor(3);
//Brake motor 2
brake(2);
//Reverse motor 2
reverse(2);
//Accelerate all motors from start to 34% power in 4 s
celerate(4,0,34,4);
//Run all motors at 30% power for 2 s
motorSpeed(4,30);
goFor(2);
//Brake motor 2 but keep motor 1 running at 30% power for 3 s
brake(2);
motorSpeed(1,30);
goFor(3);
//Brake all motors for 1 s
brake(4);
goFor(1);
//Reverse motor 1
reverse(1);
//Accelerate motor 1 from start to 15% power over 2 s
celerate(1,0,15,2);
//Run motor 2 at 21% power while simultaneously running motor 1 at 15% power for 2s
motorSpeed(2,21);
motorSpeed(1,15);
goFor(2);
//Run both motors at 21% power for 2 s
motorSpeed(4,21);
goFor(2);
//Reverse motor 1
reverse(1);
//Run both motors at their last speed for 2 s
motorSpeed(4,21);
goFor(2);
//Decelerate both motors to 0% power in 5 s
celerate(4,21,0,5);
//Brake all motors
brake(4);