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
line_tracker.h
- Committer:
- DavidEGrayson
- Date:
- 2014-03-04
- Revision:
- 31:739b91331f31
- Parent:
- 22:44c032e59ff5
- Child:
- 46:df2c2d25c070
File content as of revision 31:739b91331f31:
#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(); uint8_t calibrationState; uint16_t recentValuesMax[LINE_SENSOR_COUNT]; uint16_t recentValuesMin[LINE_SENSOR_COUNT]; bool lineVisible; uint16_t linePosition; };