Lab 1- Program Basics

Arduino Programing Basics: 

The purpose of this lab was to become familiar with the Arduino and the software that goes with it. In order to accomplish this, the team set up the Arduino board and connected it to the motors. From there, the program for scenario one was created and ran on the Arduino. From this lab, important knowledge was gained about the software and board. For example, the group now knows to make sure that the Sketchbook Location is addressed correctly.

AEV Program:

// Accelerate motor one from start to 15% power in 2.5 seconds.2.
celerate(1,0,15,2.5);
// Run motor one at a constant speed (15% power) for 1 second.
motorSpeed(1,15);
goFor(1);
//Brake motor 1
brake(1);
// Accelerate motor two from start to 27% power in 4 seconds
celerate(2,0,27,4);
// Accelerate motor two from start to 27% power in 4 seconds.
motorSpeed(2,27);
goFor(2.7);
// Decelerate motor two to 15% power in 1 second.
celerate(2,27,15,1);
// Brake motor two
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 two but keep motor one running at a constant speed //(35% power) for 3 seconds
brake(2);
motorSpeed(1,35);
goFor(3);
// Brake all motors for 1 second
brake(4);
goFor(1);
// Reverse the direction of motor one
reverse(1);
// Accelerate motor one from start to 19% power over 2 seconds
celerate(1,0,19,2);
// Run motor two at 35% power while simultaneously running motor one at 19% power for 2 seconds
motorSpeed(1,35);
goFor(2);
motorSpeed(2,19);
goFor(2);
// Run both motors at a constant speed (19% power) for 2 seconds
motorSpeed(4,19);
goFor(2);
// Run both motors at a constant speed (19% power) for 2 seconds
celerate(4,19,0,3);
// Brake all motors
brake(4);

 

Progress report questions:

When starting the program, or any time there was a break, the motors would have a delay in starting up. Other than that, the motors worked efficiently.