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: HIDScope MODSERIAL QEI TextLCD mbed
Fork of TotalControlEmg2 by
Diff: Kalibratie.cpp
- Revision:
- 30:8ae855348d22
- Parent:
- 27:f62e450bb411
- Child:
- 41:91c8c39d7a33
--- a/Kalibratie.cpp Sat Oct 17 14:13:57 2015 +0000 +++ b/Kalibratie.cpp Mon Oct 19 10:09:42 2015 +0000 @@ -14,14 +14,19 @@ LedRed = 1; } -double KalibratieMax(AnalogIn& emg){ //Kalibratie van de maximum waarde +double KalibratieMax(AnalogIn& emg, bool side){ //Kalibratie van de maximum waarde LedGreen.write(0); //Led aan double ymax = 0; for(int i = 1; i <= samples; i++) { //Als timer onder de 5 seconden is dit uitvoeren double u = emg.read(); - double y = Filterdesigns(u); - + double y = 0; + if(side){ // links + y = FilterdesignsLeft(u); + } + else { + y = FilterdesignsRight(u); // rechts + } if (y > ymax && i >= samples / 10) { //Als de gemeten waarde groter is dan de opgeslagen waarde wordt dit de nieuwe opgeslagen waarde ymax = y; } @@ -31,13 +36,19 @@ return ymax; } -double KalibratieMin(AnalogIn& emg){ //Kalibratie van de minimum waarde +double KalibratieMin(AnalogIn& emg, bool side){ //Kalibratie van de minimum waarde LedRed.write(0); double ymin = 10; for(int i = 1; i <= samples; i++) { double u = emg.read(); - double y = Filterdesigns(u); + double y = 0; + if(side){ // links + y = FilterdesignsLeft(u); + } + else { + y = FilterdesignsRight(u); // rechts + } if (y < ymin && i >= samples / 10) { ymin = y;