Filter for EMG signals The signal will be filtered using a notch, highpass and lowpass filter. The filtered signal will be compared to a preset threshold and according to the strength of the signal the program will perform an action. In this case it will assign a colour to a led.

Dependencies:   HIDScope MODSERIAL mbed

Fork of EMGfilter24 by Steven Spoolder

Revision:
2:6402a7071ba3
Parent:
1:6081dc1ecd1f
Child:
3:faed8b7f6542
--- a/main.cpp	Tue Oct 25 12:03:32 2016 +0000
+++ b/main.cpp	Tue Oct 25 12:53:45 2016 +0000
@@ -32,13 +32,12 @@
 {
     // Set the sampled emg values in channel 0 (the first channel) and 1 (the second channel) in the 'HIDScope' instance named 'scope'
     scope.set(0, emg0.read() );
-//    scope.set(1, emg1.read() );
-    /* Repeat the step above if required for more channels of required (channel 0 up to 5 = 6 channels) 
+        /* Repeat the step above if required for more channels of required (channel 0 up to 5 = 6 channels) 
     *  Ensure that enough channels are available (HIDScope scope( 2 ))
     *  Finally, send all channels to the PC at once */
     scope.send();
     // To indicate that the function is working, the LED is toggled
-    ledje = !ledje;
+    ledje = ledje;
 }
 
 
@@ -71,7 +70,8 @@
     
 while(1){
     
-    scope.set(1, lf_y);
+   scope.set(1, lf_y);
+   scope.send();
     
     }