Remco Dasselaar / Mbed 2 deprecated TotalControlEmg2

Dependencies:   HIDScope MODSERIAL QEI TextLCD mbed

Fork of TotalControlEmg2 by Remco Dasselaar

Mode.cpp

Committer:
RemcoDas
Date:
2015-10-16
Revision:
27:f62e450bb411
Parent:
19:6c0245063b96
Child:
47:959ef2792024

File content as of revision 27:f62e450bb411:

#include "Mode.h"

double mode;

int Mode(double y, double thresholdlow, double thresholdmid, double thresholdhigh){       
    if ( y <= thresholdlow){
        mode = 1;
        }
    if (y > thresholdhigh){
        mode = 3;
        }
    if (y > thresholdmid && mode == 1){
        mode = 2;
        }
    return mode;
}