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

Revision:
9:9734347b5756
Parent:
8:78b1ff957cba
Child:
10:e4dd36148539
--- 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;
-        }
+
     }
 }