Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Revision:
44:85bf2c0cd518
Parent:
43:f22168a05c3e
Child:
46:b156ef445742
--- a/main.h	Sun May 28 10:09:56 2017 +0000
+++ b/main.h	Fri Jun 02 18:50:51 2017 +0000
@@ -173,18 +173,18 @@
 //#define ID_CONSTANT 7.55
 
 const int desiredCount180 = 3120;   // change accordingly to the terrain
-const int desiredCountR = 1390;
-const int desiredCountL = 1475;
+const int desiredCountR = 1340;
+const int desiredCountL = 1455;
 
 const int oneCellCount = 5480;
-const int oneCellCountMomentum = 4590;//4570 (.15) speed;//4800;      // one cell count is actually approximately 5400, but this value is considering momentum!
+const int oneCellCountMomentum = 4578;//4570 (.15) speed;//4800;      // one cell count is actually approximately 5400, but this value is considering momentum!
 
 double receiverOneReading = 0.0;
 double receiverTwoReading = 0.0;
 double receiverThreeReading = 0.0;
 double receiverFourReading = 0.0;
 
-const double frontStop = 7.9;
+const double frontStop = 8.35;
 const double LRAvg = 3.5;
 
 float ir1base = 0.0;
@@ -272,7 +272,7 @@
  
     while(1) {
  
-        if(!(abs(error0) < 2) && !(abs(error1) < 2)) {
+        if(!(abs(error0) < 4) && !(abs(error1) < 4)) {
             count0 = encoder0.getPulses();
             count1 = encoder1.getPulses();