Filter emg 7-10-15 v1
Dependencies: HIDScope mbed MODSERIAL
Diff: Mode.cpp
- Revision:
- 18:eec0880fcded
- Child:
- 19:6c0245063b96
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Mode.cpp Mon Oct 12 10:14:18 2015 +0000 @@ -0,0 +1,19 @@ +#include "Mode.h" + +double mode; + +int Mode(double y, double ymax, double thresholdlow, double thresholdmid, double thresholdhigh) +{ + + if ( y <= thresholdlow){ + mode = 1; + } + if (y > thresholdmid && mode == 1){ + mode = 2; + } + if (y > thresholdhigh && mode == 1){ + mode = 3; + } + + return mode; +}