David's line following code from the LVBots competition, 2015.
Dependencies: GeneralDebouncer Pacer PololuEncoder mbed
Fork of DeadReckoning by
Diff: test.cpp
- Revision:
- 32:83a13b06093c
- Parent:
- 31:739b91331f31
- Child:
- 33:58a0ab6e9ad2
--- a/test.cpp Tue Mar 04 03:04:00 2014 +0000 +++ b/test.cpp Tue Mar 04 04:32:51 2014 +0000 @@ -183,16 +183,18 @@ if (lineVisiblePrevious != lineTracker.getLineVisible()) { - pc.printf("%5d ! %1d %4d | %4d %4d %4d | %5d %5d %5d\r\n", + pc.printf("%5d ! %1d %4d | %5d %5d | %4d %4d %4d\r\n", loopCount, lineTracker.getLineVisible(), lineTracker.getLinePosition(), - lineTracker.calibratedValues[0], lineTracker.calibratedValues[1], lineTracker.calibratedValues[2], - lineTracker.rawValues[0], lineTracker.rawValues[1], lineTracker.rawValues[2] + motorLeftSpeed, motorRightSpeed, + lineTracker.calibratedValues[0], lineTracker.calibratedValues[1], lineTracker.calibratedValues[2] ); } if (reportPacer.pace()) { - pc.printf("%5d %1d %4d | %4d %4d %4d\r\n", loopCount, lineTracker.getLineVisible(), lineTracker.getLinePosition(), + pc.printf("%5d %1d %4d | %5d %5d | %4d %4d %4d\r\n", + loopCount, lineTracker.getLineVisible(), lineTracker.getLinePosition(), + motorLeftSpeed, motorRightSpeed, lineTracker.calibratedValues[0], lineTracker.calibratedValues[1], lineTracker.calibratedValues[2] ); } @@ -341,7 +343,6 @@ lineTracker.updateCalibration(); } - led2 = calibrationLooksGood(); led3 = doneCalibrating; led4 = lineTracker.getLineVisible(); @@ -357,14 +358,6 @@ { pc.printf("%-2d %5d %5d %5d\r\n", s, lineTracker.calibratedMinimum[s], lineTracker.rawValues[s], lineTracker.calibratedMaximum[s]); } - if (calibrationLooksGood()) - { - pc.puts("Good. \r\n"); - } - else - { - pc.puts("Not good yet.\r\n"); - } } } }