Coursework

Revision:
16:2646c1c4e62e
Parent:
15:234321e80678
Child:
17:dee80717e423
Child:
18:bb36d96142dd
--- a/main.cpp	Thu Jan 13 20:18:10 2022 +0000
+++ b/main.cpp	Thu Jan 13 20:53:37 2022 +0000
@@ -191,10 +191,29 @@
             }
             else {
                 direction = UP;
-string output;
-        output = fsm[state];  
 
-
+       //output = fsm[state];  
+ switch(Press){
+     case 1: 
+     lcd.clear();
+     Press = 1;
+     lcd.printString("Menu 1",0,0);        
+    lcd.refresh();
+        break;
+     case 2: 
+    Press = 2;
+    lcd.clear();
+       lcd.printString("Menu 2",0,0);        
+         lcd.refresh();
+     break;
+              Press = 0;
+         lcd.clear();
+       lcd.printString("Menu 4",0,0);        
+         lcd.refresh();
+     break;
+     }
+     
+/*
 int result;
  result = cube(5);
     printf("Button A pressed  %f\n", cube(5));
@@ -295,6 +314,8 @@
         }
     
     }  
+ }*/
+ }
  }
  }
    int buttonCount(){
@@ -310,25 +331,7 @@
 {
     
     buttonCount();
-         switch(Press){
-     case 1: 
-     lcd.clear();
-     Press = 1;
-     lcd.printString("Menu 1",0,0);        
-    lcd.refresh();
-        break;
-     case 2: 
-    Press = 2;
-    lcd.clear();
-       lcd.printString("Menu 2",0,10);        
-         lcd.refresh();
-     break;
-         Press = 3;
-         lcd.clear();
-       lcd.printString("Menu 3",0,20);        
-         lcd.refresh();
-     break;
-     }
+        
     
     g_buttonA_flag = 1;   // set flag in ISR