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
Diff: line_tracker.cpp
- Revision:
- 24:fc01d9125d3b
- Parent:
- 22:44c032e59ff5
- Child:
- 31:739b91331f31
diff -r aae5cbe3b924 -r fc01d9125d3b line_tracker.cpp --- a/line_tracker.cpp Fri Feb 28 00:23:00 2014 +0000 +++ b/line_tracker.cpp Fri Feb 28 01:07:14 2014 +0000 @@ -59,11 +59,12 @@ uint32_t avg = 0; uint32_t sum = 0; + lineVisible = false; for(uint8_t s = 0; s < LINE_SENSOR_COUNT; s++) { // keep track of whether we see the line at all uint16_t value = calibratedValues[s]; - if (value > 200) + if (value > 500) { lineVisible = true; }