Jan-Willem Bisschop
/
EMG_filter
EMG filter. Waarden nog niet perfekt.
Diff: main.cpp
- Revision:
- 0:2956e3501f8a
- Child:
- 1:70dc835f3a37
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Oct 21 12:11:52 2016 +0000 @@ -0,0 +1,29 @@ +#include "mbed.h" +#include "HIDScope.h" +#include "Filter.h" +#include "FilterDesign.h" + +AnalogIn emg(A0); + +Ticker sample_timer; +HIDScope scope(2); // 2 scopes + +void sample() +{ + + double u = emg.read(); // ongefitlerd + double y = FilterDesign(u); // gefilterd + + scope.set(0,u); // ongefilterd naar scope 0 + scope.set(1,y); // gefilterd naar scope 1 + + scope.send(); +} + +int main() +{ + + sample_timer.attach(&sample, 0.002); // 500 Hz + + while(1) {} +} \ No newline at end of file