State machine

Dependencies:   mbed Adafruit_GFX BioroboticsMotorControl MODSERIAL BioroboticsEMGFilter

Revision:
46:0be634ee10e8
Parent:
39:f119ca6fc821
diff -r f0066593c174 -r 0be634ee10e8 EMG_calibration.h
--- a/EMG_calibration.h	Thu Nov 01 17:35:58 2018 +0000
+++ b/EMG_calibration.h	Thu Nov 01 17:58:56 2018 +0000
@@ -5,6 +5,8 @@
 #include "Screen.h"
 #include "EMGFilter.h"
 
+const double emg_calibration_time = 3.0;
+
 class EMG_calibration
 {
 private:
@@ -107,7 +109,7 @@
     }
     void start_relax() {
         calibration_timer.attach(callback(this, &EMG_calibration::relax_calibration), 0.1);
-        end_of_calibration.attach(callback(this, &EMG_calibration::TheFinalCalibration),5.0f);
+        end_of_calibration.attach(callback(this, &EMG_calibration::TheFinalCalibration), emg_calibration_time);
     }
 
     void tense_measure() {
@@ -122,6 +124,6 @@
     }
     void start_tense() {
         calibration_timer.attach(callback(this, &EMG_calibration::tense_calibration),0.1);
-        calibration_bicep.attach(callback(this, &EMG_calibration::relax_measure),5);
+        calibration_bicep.attach(callback(this, &EMG_calibration::relax_measure), emg_calibration_time);
     }
 };