Script of MBR Group 20. Control of robot by EMG and/or potmeters

Dependencies:   Encoder HIDScope MODSERIAL biquadFilter mbed

Fork of Script_Group_20 by Gerber Loman

Revision:
24:847321a23e60
Parent:
20:14edaecd7413
Child:
25:1c17ab3967c4
--- a/main.cpp	Fri Nov 03 02:54:09 2017 +0000
+++ b/main.cpp	Fri Nov 03 12:12:42 2017 +0000
@@ -604,12 +604,13 @@
             CalibrationEMG();   //calculates average EMGFiltered at rest and measures max signal EMGFiltered.
             break;    
         case SelectDevice: //Looks at the difference between current position and home. Select aansturen EMG or buttons
-            if (button==1) {
+            State = EMG;
+            /*if (button==1) {
                 State=EMG;
             }
             if (button==0) {
                 State=Demo;
-            }
+            }*/
             break;
         case EMG: //Aansturen met EMG
         pc.printf("EMG begint met aansturen \r\n");
@@ -669,7 +670,7 @@
   //  printer.attach(Tickerfunctie,0.4);
     
     //State Machine
-    State = Cal1;
+    State = CalEMG;
     Position_controller_on = false;
     Treecko.attach(&Loop_funtion, Ts);
     while(true)