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:
- 41:91c8c39d7a33
- Parent:
- 30:8ae855348d22
- Child:
- 44:97f5622db2c4
--- a/Kalibratie.cpp Wed Oct 21 14:17:22 2015 +0000 +++ b/Kalibratie.cpp Thu Oct 22 08:07:27 2015 +0000 @@ -1,24 +1,20 @@ #include "Kalibratie.h" #include "Filterdesigns.h" -//#include "MODSERIAL.h" //bugfix - -//AnalogIn emg2(A0); //Analog input van emg kabels -//MODSERIAL pc2(USBTX, USBRX); //bugfix +/* DigitalOut LedGreen(LED2); DigitalOut LedRed(LED1); - -int samples = 100; - +*/ +int samples = 100; // amount of samples taken +/* void Init(){ LedGreen = 1; LedRed = 1; -} +}*/ 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 + //LedGreen.write(0); //Led aan + double ymax = 0; + for(int i = 1; i <= samples; i++) { //amount of samples double u = emg.read(); double y = 0; if(side){ // links @@ -37,9 +33,8 @@ } double KalibratieMin(AnalogIn& emg, bool side){ //Kalibratie van de minimum waarde - LedRed.write(0); + //LedRed.write(0); double ymin = 10; - for(int i = 1; i <= samples; i++) { double u = emg.read(); double y = 0; @@ -48,13 +43,12 @@ } else { y = FilterdesignsRight(u); // rechts - } - + } if (y < ymin && i >= samples / 10) { ymin = y; } wait(0.05); } - LedRed.write(1); + //LedRed.write(1); return ymin; } \ No newline at end of file