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:
8:78b1ff957cba
Child:
9:9734347b5756
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/encoders.cpp	Sat Feb 22 02:23:21 2014 +0000
@@ -0,0 +1,21 @@
+#include "encoders.h"
+
+const PinName encoderPin1A = p6,
+              encoderPin1B = p7,
+              encoderPin2A = p8,
+              encoderPin2B = p9;
+
+PololuEncoderBuffer encoderBuffer;
+PololuEncoder encoder1(encoderPin1A, encoderPin1B, &encoderBuffer, ENCODER1);
+PololuEncoder encoder2(encoderPin2A, encoderPin2B, &encoderBuffer, ENCODER2);
+
+void encoders_init()
+{
+    DigitalIn(encoderPin1A).mode(PullUp);
+    DigitalIn(encoderPin1B).mode(PullUp);
+    DigitalIn(encoderPin2A).mode(PullUp);
+    DigitalIn(encoderPin2B).mode(PullUp);
+    wait_us(50);
+    encoder1.init();
+    encoder2.init();   
+}
\ No newline at end of file