David's dead reckoning code for the LVBots competition on March 6th. Uses the mbed LPC1768, DRV8835, QTR-3RC, and two DC motors with encoders.
Dependencies: PololuEncoder Pacer mbed GeneralDebouncer
Diff: test.cpp
- Revision:
- 8:78b1ff957cba
- Child:
- 9:9734347b5756
diff -r 85b8b5acfb22 -r 78b1ff957cba test.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test.cpp Sat Feb 22 02:23:21 2014 +0000 @@ -0,0 +1,40 @@ +// A file for testing routines that will not be used in the final firmware. + +#include <mbed.h> +#include "motors.h" +#include "leds.h" +#include "pc_serial.h" + +void testMotors() +{ + led1 = 1; + led2 = 0; + led3 = 0; + while(1) + { + motors_speed_set(0, 0); + led2 = 0; + led3 = 0; + wait(2); + + motors_speed_set(300, 300); + wait(2); + + motors_speed_set(-300, 300); + wait(2); + + motors_speed_set(0, 0); + led2 = 1; + wait(2); + + motors_speed_set(600, 600); + wait(2); + + motors_speed_set(0, 0); + led3 = 1; + wait(2); + + motors_speed_set(1200, 1200); + wait(2); + } +} \ No newline at end of file