State machine

Dependencies:   mbed Adafruit_GFX BioroboticsMotorControl MODSERIAL BioroboticsEMGFilter

Revision:
19:53b9729fbab5
Parent:
18:71a5cc9353af
Child:
28:25917b26022c
--- a/motor_calibration.h	Wed Oct 31 14:17:03 2018 +0000
+++ b/motor_calibration.h	Wed Oct 31 16:19:28 2018 +0000
@@ -18,13 +18,13 @@
     else
     {
         double motor_angle = current_angle;
-        motor_angle = motor_angle - 10 * motor_rad_per_angle;    // Subtracting five degree angle from the current angle
+        motor_angle = motor_angle - 3 * motor_rad_per_angle;    // Subtracting five degree angle from the current angle
         motor.set_target_angle(motor_angle); 
         iterations_not_moving = 0;            // Set time passed in this state back to zero
         //calibLED2 = !calibLED2;                              // LED turns red
     }
     
-    if (iterations_not_moving >= 20)           // After 5 seconds have passed (10 times Ticker motor_calib)
+    if (iterations_not_moving >= 40)           // After 5 seconds have passed (10 times Ticker motor_calib)
     {
         return true;
         //alibLED3 = !calibLED3;                              // LED becomes red (purple if both motors are calibrated)