Alle drie de signalen gefilterd en binair gemaakt
Dependencies: mbed HIDScope biquadFilter
Diff: main.cpp
- Revision:
- 18:21d8e7a81cf5
- Parent:
- 16:9f7797ffd0fb
- Child:
- 19:2bf824669684
--- a/main.cpp Tue Sep 22 07:00:54 2015 +0000 +++ b/main.cpp Thu Sep 22 08:04:14 2016 +0000 @@ -5,6 +5,7 @@ AnalogIn emg(A0); //Analog input Ticker sample_timer; HIDScope scope(1); +DigitalOut led(LED1); /** Sample function * this function samples the emg and sends it to HIDScope @@ -18,14 +19,16 @@ /* Repeat the step above if required for more channels (channel 0 up to 5 = 6 channels) */ /* Finally, send all channels to the PC at once */ scope.send(); + /* To indicate that the function is working, the LED is toggled */ + led = !led; } int main() { /**Attach the 'sample' function to the timer 'sample_timer'. - * this ensures that 'sample' is executed every... 0.002 seconds + * this ensures that 'sample' is executed every... 0.01 seconds */ - sample_timer.attach(&sample, 0.002); + sample_timer.attach(&sample, 0.01); /*empty loop, sample() is executed periodically*/ while(1) {}