Carter Montgomery / Mbed 2 deprecated VoodooBoi9000

Dependencies:   mbed Servo mbed-rtos 4DGL-uLCD-SE PinDetect X_NUCLEO_53L0A1

Files at this revision

API Documentation at this revision

Comitter:
nnguyen99
Date:
Tue Apr 07 16:13:28 2020 +0000
Parent:
6:6c3ccc04f07e
Child:
9:770effc3af2d
Commit message:
State machine updates

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Apr 06 02:22:37 2020 +0000
+++ b/main.cpp	Tue Apr 07 16:13:28 2020 +0000
@@ -90,25 +90,25 @@
 
 void pb1_hit_callback (void) 
 {
-    myled1 = !myled1; 
+    X = 1;
     guLCD.printf("REEST");
 }
 
 void pb2_hit_callback (void)
 {
-    myled2 = !myled2; 
+    P = 1;
     guLCD.printf("STOP");
 }
 
 void pb3_hit_callback (void) 
 {
-    myled3 = !myled3; 
+    S = 1; 
     guLCD.printf("RECORD");
 }
 
 void pb4_hit_callback (void) 
 {
-    myled4 = !myled4; 
+    R = 1; 
     guLCD.printf("PLAY");
 }
 
@@ -117,9 +117,17 @@
     while(1) {
         switch(curr_state){
             case sRESET:
+                S = 0;
+                R = 0;
+                P = 0;
+                E = 0;
                 if(S) curr_state = sSTOP;
                 break;
             case sSTOP:
+                X = 0;
+                R = 0;
+                P = 0;
+                E = 0;
                 if(X){
                     curr_state = sRESET;
                 }else if(S&R){
@@ -129,6 +137,10 @@
                 }
                 break;
             case sRECORD:
+                S = 0;
+                X = 0;
+                P = 0;
+                E = 0;
                 if(X){
                     curr_state = sRESET;
                 }else if(R&S){
@@ -138,6 +150,10 @@
                 }
                 break;
             case sPLAY:
+                S = 0;
+                R = 0;
+                X = 0;
+                E = 0;
                 if(X){
                     curr_state = sRESET;
                 }else if(P&S){