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: Mode.cpp
- Revision:
- 50:16314b798754
- Parent:
- 47:959ef2792024
--- a/Mode.cpp Tue Oct 27 12:01:44 2015 +0000 +++ b/Mode.cpp Wed Oct 28 09:28:48 2015 +0000 @@ -1,13 +1,13 @@ #include "Mode.h" - +// Determine mode from thresholds int Mode(int mode, double y, double thresholdlow, double thresholdmid, double thresholdhigh){ - if ( y <= thresholdlow){ + if ( y <= thresholdlow){ // lowest threshold mode = 1; } - else if (y > thresholdhigh){ + else if (y > thresholdhigh){ // above highest threshold mode = 3; } - if (y > thresholdmid && mode == 1){ + if (y > thresholdmid && mode == 1){ // Not from mode 3 to mode 2 mode = 2; } return mode;