Dit is em

Dependencies:   biquadFilter MODSERIAL mbed

Fork of StateMachineJerry by Gaston Gabriël

Revision:
8:77dbdfe15779
Parent:
7:88fa84742b3c
--- a/main.cpp	Thu Nov 01 16:31:57 2018 +0000
+++ b/main.cpp	Thu Nov 01 18:56:12 2018 +0000
@@ -94,7 +94,7 @@
             led1=!led1;
             if(emg1_filtered>temp_highest_emg1) {
                 temp_highest_emg1= emg1_filtered;
-                pc.printf("Temp1 = %f \r\n",temp_highest_emg1);
+                //pc.printf("Temp1 = %f \r\n",temp_highest_emg1);
             }
         }
         if(timer_calibration>10 && timer_calibration<15) {
@@ -106,7 +106,7 @@
             led2=!led2;
             if(emg2_filtered>temp_highest_emg2) {
                 temp_highest_emg2= emg2_filtered;
-                pc.printf("Temp2 = %f \r\n",temp_highest_emg2);
+                //pc.printf("Temp2 = %f \r\n",temp_highest_emg2);
             }
         }
         if(timer_calibration>25 && timer_calibration<30) {
@@ -118,7 +118,7 @@
             led3=!led3;
             if(emg3_filtered>temp_highest_emg3) {
                 temp_highest_emg3= emg3_filtered;
-                pc.printf("Temp3 = %f \r\n",temp_highest_emg3);
+                //pc.printf("Temp3 = %f \r\n",temp_highest_emg3);
             }
         }
         if(timer_calibration>40 && timer_calibration<45) {
@@ -131,7 +131,7 @@
             led3=!led3;
             if(emg4_filtered>temp_highest_emg4) {
                 temp_highest_emg4= emg4_filtered;
-                pc.printf("Temp4 = %f \r\n",temp_highest_emg4);
+                //pc.printf("Temp4 = %f \r\n",temp_highest_emg4);
             }
         }
         led1=1;
@@ -141,10 +141,10 @@
 
     }
 
-    pc.printf("Highest value right biceps= %f \r\n", temp_highest_emg1);
-    pc.printf("Highest value right triceps= %f \r\n", temp_highest_emg2);
-    pc.printf("Highest value left biceps= %f \r\n", temp_highest_emg3);
-    pc.printf("Highest value left triceps= %f \r\n", temp_highest_emg4);
+    //pc.printf("Highest value right biceps= %f \r\n", temp_highest_emg1);
+    //pc.printf("Highest value right triceps= %f \r\n", temp_highest_emg2);
+    //pc.printf("Highest value left biceps= %f \r\n", temp_highest_emg3);
+    //pc.printf("Highest value left triceps= %f \r\n", temp_highest_emg4);
 
 
     threshold1 = temp_highest_emg1*biceps_p_t;  //Right Biceps
@@ -254,7 +254,7 @@
                 timer_calibration.reset();
                 timer_calibration.start();
 
-                sample_ticker.attach(&emgsample, ts);
+                sample_ticker.attach(&emgsample, ts); 
                 CalibrationEMG();
                 sample_ticker.detach();
                 timer_calibration.stop();
@@ -365,7 +365,7 @@
                 stateChanged = true;
             }
             // here ends the idle checking mode
-            else {
+            else{
                 //For every muscle a different colour if threshold is passed
                 if(bicepsR==1) {
                     led1 = 0;
@@ -403,8 +403,8 @@
                     led2 = 1;
                     led3 = 1;
                 }
-                currentState = MOVEMENT  ;
-                stateChanged = false;
+                //currentState = MOVEMENT  ;
+                //stateChanged = false;
             }
 
             break;