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:
44:b4a00fbab06b
Parent:
43:0e985a58f174
Child:
45:81dd782bc0b4
--- a/test.cpp	Sat Jul 27 22:52:19 2019 +0000
+++ b/test.cpp	Sun Jul 28 01:22:01 2019 +0000
@@ -35,6 +35,7 @@
 void testCloseness()
 {
     doGyroCalibration();
+    turnSensor.start();
     led1 = 1;
     while(1)
     {
@@ -55,6 +56,8 @@
 void testTurnInPlace()
 {
     doGyroCalibration();
+    turnSensor.start();
+
     led1 = 1;
     while(!button1DefinitelyPressed())
     {
@@ -105,6 +108,9 @@
 // This also tests the LineTracker by printing out a lot of data from it.
 void testLineFollowing()
 {
+    doGyroCalibration();
+    turnSensor.start();
+
     led1 = 1;   
     while(!button1DefinitelyPressed())
     {
@@ -148,6 +154,7 @@
 void testDriveHome()
 {
     doGyroCalibration();
+    turnSensor.start();
     led1 = 1;   
     while(!button1DefinitelyPressed())
     {
@@ -167,6 +174,7 @@
 void testFinalSettleIn()
 {
     doGyroCalibration();
+    turnSensor.start();
     led1 = 1;
     while(!button1DefinitelyPressed())
     {
@@ -199,12 +207,11 @@
 void testReckoner()
 {
     doGyroCalibration();
+    turnSensor.start();
     led1 = 1;
-    turnSensor.start();
     Pacer reportPacer(100000);
     while(1)
     {
-        turnSensor.update();
         updateReckoner();
         
         led1 = reckoner.x > 0;