State machine

Dependencies:   mbed Adafruit_GFX BioroboticsMotorControl MODSERIAL BioroboticsEMGFilter

Revision:
10:b165ccd11afd
Parent:
9:27d00b64076e
Child:
11:d980e0e581db
diff -r 27d00b64076e -r b165ccd11afd main.cpp
--- a/main.cpp	Wed Oct 31 08:17:35 2018 +0000
+++ b/main.cpp	Wed Oct 31 08:21:20 2018 +0000
@@ -13,7 +13,7 @@
 const double main_loop_wait_time = 0.01;
 
 // Time between two button polls. Used to debounce the button presses.
-const double button_poll_interval = 0.1;
+const double button_poll_interval = 0.05;
 
 const float pid_period = 0.001; // PID sample period in seconds.
 
@@ -212,6 +212,8 @@
     led_green = 1;
     led_blue = 1;
     
+    screen.clear_display();
+    
     motor1.set_pid_k_values(Kp, Ki, Kd);
     motor2.set_pid_k_values(Kp, Ki, Kd);
     // Start the motor controller at the desired frequency.