Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed HIDScope BiQuad4th_order biquadFilter MODSERIAL
Diff: main.cpp
- Revision:
- 22:08b3cd7bec7f
- Parent:
- 21:2c26b74a3e48
--- a/main.cpp Tue Oct 29 09:51:59 2019 +0000
+++ b/main.cpp Tue Oct 29 12:11:23 2019 +0000
@@ -25,7 +25,7 @@
volatile double emg2_filtered; //measured value of the second emg
volatile double emg1_max ; // calibrated value of first emg
volatile double emg2_max ;
-volatile double emg1_cal = 0.1;
+volatile double emg1_cal = 0.8;
// Read EMG
//void EMGread()
@@ -60,10 +60,13 @@
if(SW3==0){
EMGcalibration();
}
- if(emg1_filtered >= 0.8){
- led = !led;
- }
- }
+
+ led = 1;
+
+ while(emg1_filtered >= 0.9*emg1_cal){
+ led = 0;
+ }
+ }
}