Richard Roos / Mbed 2 deprecated TotalControlEmg2

Dependencies:   HIDScope MODSERIAL QEI TextLCD mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Mode.cpp Source File

Mode.cpp

00001 #include "Mode.h"
00002 
00003 double mode;
00004 
00005 int Mode(double y, double thresholdlow, double thresholdmid, double thresholdhigh){       
00006     if ( y <= thresholdlow){
00007         mode = 1;
00008         }
00009     if (y > thresholdhigh){
00010         mode = 3;
00011         }
00012     if (y > thresholdmid && mode == 1){
00013         mode = 2;
00014         }
00015     return mode;
00016 }