Lab 2 Code (External Sensors)

Programming Objective

The goal for this code was to use the Arduino to program our and successfully configure our code and hardware so the External Sensors are able to record data. These data values include raw values such as marks, voltage (counts) and amp (counts) that can later be converted to more appropriate measurements.

Arduino Program

//Run all motors at a constant speed of 25% power for 2 seconds

motorSpeed(4,25);
goFor(2);

//Run all motors at a constant speed of 20% and using the goToAbsolute function travel 12 feet (Do this by had since we are using desktop tracks)

motorSpeed(4,20);
goToAbsolutePosition(12);

//reverse Motors

reverse(4);

//Brake all motors
brake(4);

//Save the program as ExternalSensorsOutside