Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Revision:
35:a5bd9ef82210
Parent:
34:69342782fb68
Child:
36:9c4cc9944b69
--- a/main.cpp	Fri May 26 17:21:04 2017 +0000
+++ b/main.cpp	Sat May 27 00:41:19 2017 +0000
@@ -39,7 +39,7 @@
 */
 
 #define IP_CONSTANT 1.93
-#define II_CONSTANT 0.00001
+#define II_CONSTANT 0.0001
 #define ID_CONSTANT 0.175
 
 void pidOnEncoders();
@@ -857,6 +857,14 @@
     dipButton3.fall(&disableButton3);
     dipButton4.fall(&disableButton4);
 
+    serial.printf("%d, %d, %d\n", dipFlags, BUTTON1_FLAG, dipFlags & BUTTON1_FLAG);
+    while( (dipFlags & BUTTON4_FLAG) == 0 )
+    {
+        // do nothing until ready
+    }
+    serial.printf("%d, %d, %d\n", dipFlags, BUTTON1_FLAG, dipFlags & BUTTON1_FLAG);
+    wait( 2 );
+
     // init the wall, and mouse loc arrays:
     wallArray[MAZE_LEN - 1 - mouseY][mouseX] = 0xE;
     visitedCells[MAZE_LEN - 1 - mouseY][mouseX] = 1;