2014-10-15 Arm 1 naar thuispositie. Eerste poging, fout in keep_in_range

Dependencies:   Encoder MODSERIAL TextLCD mbed mbed-dsp

Revision:
5:a1dcd605dd3d
Parent:
4:69540b9c0646
Child:
6:3b6fad529520
--- a/main.cpp	Thu Oct 16 12:42:21 2014 +0000
+++ b/main.cpp	Thu Oct 16 13:32:57 2014 +0000
@@ -61,6 +61,8 @@
 int puls_arm2_home = 787;
 float pwm_to_motor_arm1;
 float pwm_to_motor_arm2;
+float xbk;
+int i = 0;
 
 //Beginwaarden voor variabelen
 
@@ -136,8 +138,9 @@
                  kalibratie_positie_arm2 = true;
                  pc.printf("Arm 2 naar thuispositie compleet");
             }        
-            wait(1); 
         }
+        wait(1); 
+        ticker_regelaar.detach();
     }
     
     //Ticker voor kalibratie
@@ -145,6 +148,20 @@
         
         ticker_EMG.attach(setregelaar_EMG_flag,SAMPLETIME_EMG);
         pc.printf("Ticker voor kalibratie compleet");
+        
+        //5 seconden EMG biceps meten
+        
+        wait(1);
+        lcd_r1 = " EMG kalibratie ";
+        lcd_r2 = " Span biceps aan";
+        
+        for (i=0 ,i<5000, i++){
+            while(setregelaar_EMG_flag != true) ;
+            regelaar_EMG_flag = false;
+            
+            xbk = EMG_bi.read();
+        }
+            
     }