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:
21:c279c6a83671
Child:
22:44c032e59ff5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/line_tracker.h	Thu Feb 27 23:20:34 2014 +0000
@@ -0,0 +1,28 @@
+#pragma once
+
+#include "line_sensors.h"
+
+class LineTracker
+{
+    public:
+    LineTracker();
+    
+    void updateCalibration();
+    
+    void read();    
+    bool getLineVisible();
+    uint16_t getLinePosition();
+    
+    uint16_t rawValues[LINE_SENSOR_COUNT];
+    uint16_t calibratedValues[LINE_SENSOR_COUNT];
+    uint16_t calibratedMaximum[LINE_SENSOR_COUNT];
+    uint16_t calibratedMinimum[LINE_SENSOR_COUNT];
+    
+    private:
+    void readRawValues();
+    void updateCalibratedValues();
+    void updateLineStatus();
+    
+    bool lineVisible;
+    uint16_t linePosition;
+};