David's line following code from the LVBots competition, 2015.
Dependencies: GeneralDebouncer Pacer PololuEncoder mbed
Fork of DeadReckoning by
Diff: main.cpp
- Revision:
- 9:9734347b5756
- Parent:
- 8:78b1ff957cba
- Child:
- 10:e4dd36148539
diff -r 78b1ff957cba -r 9734347b5756 main.cpp --- a/main.cpp Sat Feb 22 02:23:21 2014 +0000 +++ b/main.cpp Sat Feb 22 03:03:37 2014 +0000 @@ -3,40 +3,24 @@ #include "motors.h" #include "encoders.h" +#include "leds.h" #include "pc_serial.h" -#include "leds.h" +#include "test.h" int main() { pc.baud(115200); // Enable pull-ups on encoder pins and give them a chance to settle. - encoders_init(); - motors_init(); + encodersInit(); + motorsInit(); // Test routines - motors_test(); - encoders_test(); + //testMotors(); + testEncoders(); - Pacer reportPacer(500000); - Pacer blinkPacer(200000); while(1) { - while(encoderBuffer.hasEvents()) - { - PololuEncoderEvent event = encoderBuffer.readEvent(); - } - - if(reportPacer.pace()) - { - led2 = 1; - pc.printf("%8d %8d\n", encoder1.getCount(), encoder2.getCount()); - led2 = 0; - } - - if (blinkPacer.pace()) - { - led1 = !led1; - } + } }