State Machine, bezig met mooimaken

Dependencies:   Encoder HIDScope MODSERIAL biquadFilter mbed

Fork of vanEMGnaarMOTORPauline_States_nacht by Projectgroep 20 Biorobotics

Revision:
17:dbdbd1edc260
Parent:
16:2f89d6e25782
Child:
18:1e4f697a92cb
--- a/main.cpp	Thu Nov 02 13:43:01 2017 +0000
+++ b/main.cpp	Thu Nov 02 22:32:42 2017 +0000
@@ -14,7 +14,6 @@
 double value;
 double home1;
 DigitalIn button (D4);
-DigitalOut led(LED_RED);
 
 //Encoder/motor
 double Huidigepositie1;
@@ -56,9 +55,7 @@
 //buttons  en leds voor calibration
 DigitalIn button1(PTA4);
 
-DigitalOut ledred(LED_RED); 
-DigitalOut ledblue(LED_BLUE);
-DigitalOut ledgreen(LED_GREEN);
+DigitalOut led(D2)
 
 //MVC for calibration
 double MVCLB = 0; double MVCRB = 0; double MVCLT = 0; double MVCRT = 0;
@@ -211,6 +208,9 @@
     
     if(Timescalibration<2000)
     {
+        led = 1;
+        wait(0.2);
+        led = 0;
         
     emgNotchLB = NFLB.step(emgLB.read() );
     emgHPLB = HPFLB.step(emgNotchLB);   
@@ -238,6 +238,13 @@
     }
     if(Timescalibration==1999)
     {
+        led = 1;
+        wait(0.2);
+        led = 0; 
+        wait(0.2);
+        led = 1;
+        wait(0.2);
+        led = 0;
         RESTMEANLB = emgSUMLB/Timescalibration; //determine the mean rest value
         RESTMEANRB = emgSUMRB/Timescalibration; //determine the mean rest value
         RESTMEANRT = emgSUMRT/Timescalibration; //determine the mean rest value
@@ -245,6 +252,17 @@
     }
     if(Timescalibration>2000 && Timescalibration<6000)
     {
+        led = 1;
+        wait(0.2);
+        led = 0;
+        wait(0.2);
+        led = 1;
+        wait(0.2);
+        led = 0;
+        wait(0.2);
+        led = 1;
+        wait(0.2);
+        led = 0;
     emgNotchLB = NFLB.step(emgLB.read() ); 
     emgHPLB = HPFLB.step(emgNotchLB);        
     emgAbsHPLB = abs(emgHPLB);          
@@ -258,6 +276,21 @@
     
     if(Timescalibration>6000 && Timescalibration<10000)
     {
+        led = 1;
+        wait(0.2);
+        led = 0;
+        wait(0.2);
+        led = 1;
+        wait(0.2);
+        led = 0;
+        wait(0.2);
+        led = 1;
+        wait(0.2);
+        led = 0;
+        wait(0.2);
+        led = 1;
+        wait(0.2);
+        led = 0;
     emgNotchRB = NFRB.step(emgRB.read()); 
     emgHPRB = HPFRB.step(emgNotchRB); 
     emgAbsHPRB = abs(emgHPRB);           
@@ -271,6 +304,25 @@
     
     if(Timescalibration>10000 && Timescalibration<14000)
     {
+        led = 1;
+        wait(0.2);
+        led = 0;
+        wait(0.2);
+        led = 1;
+        wait(0.2);
+        led = 0;
+        wait(0.2);
+        led = 1;
+        wait(0.2);
+        led = 0;
+        wait(0.2);
+        led = 1;
+        wait(0.2);
+        led = 0;
+        wait(0.2);
+        led = 1;
+        wait(0.2);
+        led = 0;
     emgNotchLT = NFLT.step(emgLT.read() );
     emgHPLT = HPFLT.step(emgNotchLT);
     emgAbsHPLT = abs(emgHPLT);