Remco Dasselaar / Mbed 2 deprecated TotalControlEmg2

Dependencies:   HIDScope MODSERIAL QEI TextLCD mbed

Fork of TotalControlEmg2 by Remco Dasselaar

Revision:
47:959ef2792024
Parent:
27:f62e450bb411
Child:
50:16314b798754
--- a/Mode.cpp	Fri Oct 23 10:23:42 2015 +0000
+++ b/Mode.cpp	Fri Oct 23 13:37:26 2015 +0000
@@ -1,12 +1,10 @@
 #include "Mode.h"
 
-double mode;
-
-int Mode(double y, double thresholdlow, double thresholdmid, double thresholdhigh){       
+int Mode(int mode, double y, double thresholdlow, double thresholdmid, double thresholdhigh){       
     if ( y <= thresholdlow){
         mode = 1;
         }
-    if (y > thresholdhigh){
+    else if (y > thresholdhigh){
         mode = 3;
         }
     if (y > thresholdmid && mode == 1){