EMG signals all around zero, not showing differences anymore in hidscope

Dependencies:   HIDScope MODSERIAL biquadFilter mbed

Fork of a_check_emg_filtered_without_cal by Daniqe Kottelenberg

Revision:
7:42d0e38196f1
Parent:
6:83358367e413
Child:
8:cd0cb71b69f2
diff -r 83358367e413 -r 42d0e38196f1 main.cpp
--- a/main.cpp	Fri Oct 21 13:34:24 2016 +0000
+++ b/main.cpp	Fri Oct 21 13:43:43 2016 +0000
@@ -12,7 +12,9 @@
 //define variables
 double emg_0_value;
 double emg_gefilterd;
-double emg_abs
+double emg_abs;
+int    onoffsignal=0;
+double cut_off_value=0.05; //gespecifeerd door floortje
 
 biquadFilter filterhigh1(-1.1430, 0.4128, 0.6389, -1.2779, 0.6389);
 
@@ -21,11 +23,17 @@
         emg_gefilterd= filterhigh1.step(emg_0_value);
         emg_abs=abs(emg_gefilterd);
         led=!led;
-                     
+        
+        if (emg_abs>cut_off_value)
+        {onoffsignal=1;}
+          
+        else 
+        {onoffsignal=0;}
+                      
         //send signals  to scope
         scope.set(0, emg_0_value );           //set emg signal to scope in channel 1
         scope.set(1, emg_gefilterd );    
-        scope.set(2, emg_abs);
+        scope.set(2, onoffsignal);
         scope.send();                       //send all the signals to the scope
                 }