totale unit
Dependencies: mbed QEI HIDScope BiQuad4th_order biquadFilter MODSERIAL FastPWM
Diff: main.cpp
- Revision:
- 22:08b3cd7bec7f
- Parent:
- 21:2c26b74a3e48
- Child:
- 23:d13db573a875
diff -r 2c26b74a3e48 -r 08b3cd7bec7f main.cpp --- 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; + } + } }