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:
31:739b91331f31
Parent:
24:fc01d9125d3b
Child:
46:df2c2d25c070
--- a/line_tracker.cpp	Tue Mar 04 02:09:54 2014 +0000
+++ b/line_tracker.cpp	Tue Mar 04 03:04:00 2014 +0000
@@ -1,10 +1,5 @@
 #include "line_tracker.h"
 
-static uint16_t readSensor(uint8_t index)
-{
-    return lineSensorsAnalog[index].read_u16();
-}
-
 LineTracker::LineTracker()
 {
     for(uint8_t s = 0; s < LINE_SENSOR_COUNT; s++)
@@ -24,10 +19,7 @@
 
 void LineTracker::readRawValues()
 {
-    for(uint8_t s = 0; s < LINE_SENSOR_COUNT; s++)
-    {
-        rawValues[s] = readSensor(s);
-    }
+    readSensors(rawValues);
 }
 
 void LineTracker::updateCalibratedValues()