Dit is alleen het EMG gedeelte

Dependencies:   mbed HIDScope biquadFilter MODSERIAL FXOS8700Q

Revision:
17:e4e7b1fbb263
Parent:
16:7acbcc4aa35c
Child:
18:9f24792bb39a
diff -r 7acbcc4aa35c -r e4e7b1fbb263 main.cpp
--- a/main.cpp	Tue Oct 22 10:25:22 2019 +0000
+++ b/main.cpp	Fri Oct 25 07:50:35 2019 +0000
@@ -171,20 +171,30 @@
 
     // Output raw EMG input
     scope.set(0, emg1 );
+    scope.set(1, emg2 );
     
-    double emg1_n = bqc_notch.step( emg1 ); // Filter notch
-    scope.set(1, emg1_n);
-    double emg1_hp = bqc_high.step( emg1_n ); // Filter highpass
-    scope.set(2, emg1_hp);
-    double emg1_rectify = fabs( emg1_hp ); // Rectify
-    scope.set(3, emg1_rectify);
+    double emg1_n = bqc_notch.step( emg1 );         // Filter notch
+    double emg1_hp = bqc_high.step( emg1_n );       // Filter highpass
+    double emg1_rectify = fabs( emg1_hp );          // Rectify
     double emg1_env = bqc_low.step( emg1_rectify ); // Filter lowpass (completes envelope)
+    
+    double emg2_n = bqc_notch.step( emg2 );         // Filter notch
+    double emg2_hp = bqc_high.step( emg2_n );       // Filter highpass
+    double emg2_rectify = fabs( emg2_hp );          // Rectify
+    double emg2_env = bqc_low.step( emg2_rectify ); // Filter lowpass (completes envelope)
+    
+    // scope.set(1, emg1_n);
+    // scope.set(1, emg1_n);
+    // scope.set(3, emg1_rectify);
 
     // Output EMG after filters
-    scope.set(4, emg1_env );
+    scope.set(2, emg1_env );
+    scope.set(3, emg2_env );
     scope.send();
 
-    emg1_cal.push_back(emg1_env);
+    // IF STATEMENT TOEVOEGEN VOOR CALIBRATIE
+    emg1_cal.push_back(emg1_env); // Add values to calibration vector
+    emg2_cal.push_back(emg2_env); // Add values to calibration vector
 }
 
 /*