MTM PPO mbed2d-2 program

Dependencies:   LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI

Revision:
2:ce9137eb0655
Parent:
1:3f9eb24c51b2
--- a/main.cpp	Mon May 11 09:27:05 2020 +0000
+++ b/main.cpp	Mon Jun 22 14:15:01 2020 +0000
@@ -1,15 +1,31 @@
 #include "mbed.h"
-#include "Keyboard_Ts_Lcd.h"
+#include "KeyboardLed.h"
+
+LCD_DISCO_F429ZI lcd;
 
 int main()
 {
-    KeyboardTsLcd TouchKeyboard(0);
-    KeyboardTsLcd LedKeyboard(2);
+    KeyboardLed TouchKeyboard(0);
+    Ledboard *pLedBoard = new Ledboard(2);
     while(1) 
     {
-        TouchKeyboard.eRead();
-        wait(0.005);
-        LedKeyboard.pLed->On(3 - TouchKeyboard.pKeyboard->eRead());      
-        wait(0.095);
+        switch(TouchKeyboard.eRead()) {
+            case BUTTON_0:
+                pLedBoard->On(3);
+                break;
+            case BUTTON_1:
+                pLedBoard->On(2);
+                break;
+            case BUTTON_2:
+                pLedBoard->On(1);
+                break;
+            case BUTTON_3:
+                pLedBoard->On(0);
+                break;
+            default :
+                pLedBoard->Off();
+                break;
+        }
+    wait(0.1);
     }
 }
\ No newline at end of file