David's line following code from the LVBots competition, 2015.
Dependencies: GeneralDebouncer Pacer PololuEncoder mbed
Fork of DeadReckoning by
Diff: main.cpp
- Revision:
- 4:1b20a11765c8
- Parent:
- 3:59c80d4b4bf2
- Child:
- 5:01ad080dc4fa
diff -r 59c80d4b4bf2 -r 1b20a11765c8 main.cpp --- a/main.cpp Thu Feb 20 22:24:32 2014 +0000 +++ b/main.cpp Thu Feb 20 22:59:28 2014 +0000 @@ -1,6 +1,7 @@ #include <mbed.h> #include "PololuEncoder.h" #include "Pacer.h" +#include "motors.h" DigitalOut led1(LED1), led2(LED2); @@ -30,12 +31,17 @@ wait_us(50); encoder1.init(); encoder2.init(); + + motors_init(); + + motors_speed_set(5, 55); Pacer reportPacer(250000); Pacer blinkPacer(200000); uint32_t eventCount = 0; uint32_t count = 0; - while(1) { + while(1) + { while(encoderBuffer.hasEvents()) { PololuEncoderEvent event = encoderBuffer.readEvent();