This is with minumum of 10 milliseconds threshold delay 00:53

Dependencies:   biquadFilter MODSERIAL QEI Servo mbed

Fork of StateMachine_EMg_RKI_PID_MOTOR_metklikenalles by Gaston Gabriël

Revision:
6:f55ab7e38a7f
Parent:
5:19f59a855475
Child:
7:88fa84742b3c
--- a/main.cpp	Thu Nov 01 15:29:32 2018 +0000
+++ b/main.cpp	Thu Nov 01 15:40:37 2018 +0000
@@ -64,13 +64,6 @@
     emg3_filtered = lowp3.step(emg3_abs);
     emg4_filtered = lowp4.step(emg4_abs);
     
-    
-    //Send data to HIDScope
-    //scope.set(0,emg1_filtered ); ONLY FOR VISUALIZATION
-    //scope.set(1,emg2_filtered);
-    //scope.set(2,emg3_filtered);
-    //scope.set(3,emg4_filtered);
-    //scope.send();
           
     }
     
@@ -85,7 +78,8 @@
     volatile double temp_highest_emg4 = 0;
     
     //Doubles for calculation threshold
-    double p_t = 0.4; //set threshold at percentage of highest value
+    double biceps_p_t = 0.4; //set threshold at percentage of highest value
+    double triceps_p_t = 0.5; //set threshold at percentage of highest value
     volatile double threshold1;
     volatile double threshold2;
     volatile double threshold3;
@@ -163,10 +157,10 @@
     pc.printf("Highest value left triceps= %f \r\n", temp_highest_emg4);
     
     
-    threshold1 = temp_highest_emg1*p_t;
-    threshold2 = temp_highest_emg2*p_t; 
-    threshold3 = temp_highest_emg3*p_t;
-    threshold4 = temp_highest_emg4*p_t;   
+    threshold1 = temp_highest_emg1*biceps_p_t;  //Right Biceps
+    threshold2 = temp_highest_emg2*triceps_p_t; //Right Triceps
+    threshold3 = temp_highest_emg3*biceps_p_t;  //Left Biceps
+    threshold4 = temp_highest_emg4*triceps_p_t; //Left Triceps  
 }
 
 //Check if emg_filtered has reached their threshold