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:
41:3ead1dd2cc3a
Parent:
40:6fa672be85ec
Child:
42:96671b71aac5
--- 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();