Filter emg 7-10-15 v1
Dependencies: HIDScope mbed MODSERIAL
Diff: Kalibratie.cpp
- Revision:
- 24:38cd27737a43
- Parent:
- 22:c1811e60bfce
--- a/Kalibratie.cpp Thu Oct 15 10:16:44 2015 +0000 +++ b/Kalibratie.cpp Wed Oct 12 15:31:14 2016 +0000 @@ -2,7 +2,7 @@ #include "Filterdesigns.h" //#include "MODSERIAL.h" //bugfix -AnalogIn emg2(A0); //Analog input van emg kabels +//AnalogIn emg2(A0); //Analog input van emg kabels niet meer nodig //MODSERIAL pc2(USBTX, USBRX); //bugfix DigitalOut LedGreen(LED2); DigitalOut LedRed(LED1); @@ -15,14 +15,14 @@ LedRed = 1; } -double KalibratieMax(bool &readymax) //Kalibratie van de maximum waarde +double KalibratieMax(bool &readymax, AnalogIn emg) //Kalibratie van de maximum waarde { //pc2.baud(115200); 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 = emg2.read(); + double u = emg.read(); double y = Filterdesigns(u); if (y > ymax && i >= samples / 10) { //Als de gemeten waarde groter is dan de opgeslagen waarde wordt dit de nieuwe opgeslagen waarde @@ -38,14 +38,14 @@ return ymax; } -double KalibratieMin(bool &readymin) //Kalibratie van de minimum waarde +double KalibratieMin(bool &readymin, AnalogIn emg) //Kalibratie van de minimum waarde { //pc2.baud(115200); LedRed.write(0); double ymin = 10; for(int i = 1; i <= samples; i++) { - double u = emg2.read(); + double u = emg.read(); double y = Filterdesigns(u); if (y < ymin && i >= samples / 10) {