![](/media/cache/profiles/ebb9a55061af33b68d38f7ce72e4460f.50x50_q85.jpg)
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: main.cpp
- Revision:
- 41:3ead1dd2cc3a
- Parent:
- 40:6fa672be85ec
- Child:
- 42:96671b71aac5
diff -r 6fa672be85ec -r 3ead1dd2cc3a main.cpp --- a/main.cpp Thu Jul 25 02:53:34 2019 +0000 +++ b/main.cpp Thu Jul 25 03:20:41 2019 +0000 @@ -15,6 +15,8 @@ #include "l3g.h" #include "turn_sensor.h" +void doDeadReckoning(); + Reckoner reckoner; LineTracker lineTracker; TurnSensor turnSensor; @@ -56,6 +58,7 @@ //testMotorSpeed(); //testLineSensors(); //testL3g(); + //testL3gAndCalibrate(); testTurnSensor(); //testReckoner(); //testButtons(); @@ -68,17 +71,20 @@ //testTurnInPlace(); //testCloseness(); //testLogger(); - + + loadCalibration(); - // Real routines for the contest. - loadCalibration(); - + doDeadReckoning(); +} + +void doDeadReckoning() +{ setLeds(1, 0, 0, 0); waitForSignalToStart(); setLeds(0, 1, 0, 0); findLine(); - + //setLeds(1, 1, 0, 0); //turnRightToFindLine();