; vergeten ergens?

Dependencies:   HIDScope biquadFilter mbed

Fork of a_check_emg_filtered_new_lib by Daniqe Kottelenberg

Revision:
9:464c447ce82d
Parent:
8:cd0cb71b69f2
Child:
10:7255b59224cc
--- a/main.cpp	Fri Oct 21 13:50:48 2016 +0000
+++ b/main.cpp	Fri Oct 21 14:07:00 2016 +0000
@@ -13,18 +13,20 @@
 
 //define variables
 double emg_0_value;
-double emg_gefilterd;
+double emg_gefilterd_high;
+double emg_gefilterd_low;
 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);
-
+biquadFilter filterhigh1(9.1497e-01,-1.8299e+00,9.1497e-01, -1.8227e+00,   8.3718e-01);
+biquadFilter filterlow1 (3.9130e-05, 7.8260e-05, 3.9130e-05,  -1.9822e+00,   9.8239e-01);
 
 void filter(){
         emg_0_value=emg0.read();                            //read the emg value from the elektrodes
-        emg_gefilterd= filterhigh1.step(emg_0_value);
-        emg_abs=abs(emg_gefilterd);
+        emg_gefilterd_high= filterhigh1.step(emg_0_value);
+        emg_abs=abs(emg_gefilterd_high);
+        emg_gefilterd_low = filterlow1.step(emg_abs);
         led=!led;
         
         if (emg_abs>cut_off_value)
@@ -35,7 +37,7 @@
                       
         //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(1, emg_gefilterd_low);    
         scope.set(2, onoffsignal);
         scope.send();                       //send all the signals to the scope
                 }
@@ -53,7 +55,7 @@
         if (onoffsignal==1)
         {
         richting_motor1 = 0;    //motordirection (ccw)
-        pwm_motor1 = 1;         //motorspeed 1  
+        pwm_motor1 = 5;         //motorspeed 1  
         
         }
         else if(onoffsignal==0)