mbed3 zad 4

Dependencies:   LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI LEDBOARD BSP_DISCO_F429ZI KEYBOARD

Files at this revision

API Documentation at this revision

Comitter:
krzysiek99
Date:
Sat Jun 13 13:30:27 2020 +0000
Commit message:
mbed3 zad 4

Changed in this revision

BSP_DISCO_F429ZI.lib Show annotated file Show diff for this revision Revisions of this file
KEYBOARD.lib Show annotated file Show diff for this revision Revisions of this file
KeyboardLed/KeyboardLed.cpp Show annotated file Show diff for this revision Revisions of this file
KeyboardLed/KeyboardLed.h Show annotated file Show diff for this revision Revisions of this file
LCD_DISCO_F429ZI.lib Show annotated file Show diff for this revision Revisions of this file
LEDBOARD.lib Show annotated file Show diff for this revision Revisions of this file
TS_DISCO_F429ZI.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BSP_DISCO_F429ZI.lib	Sat Jun 13 13:30:27 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/ST/code/BSP_DISCO_F429ZI/#53d9067a4feb
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/KEYBOARD.lib	Sat Jun 13 13:30:27 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/krzysiek99/code/KEYBOARD/#374a3d1fe780
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/KeyboardLed/KeyboardLed.cpp	Sat Jun 13 13:30:27 2020 +0000
@@ -0,0 +1,29 @@
+#include "KeyboardLed.h"
+
+KeyboardLed::KeyboardLed(unsigned char ucColumn)
+{
+    pKeyboard = new Keyboard(ucColumn);
+    pLedboard = new Ledboard(ucColumn);
+}
+
+enum KeyboardState KeyboardLed::eRead()
+{
+    switch(pKeyboard->eRead()) 
+    {
+        case BUTTON_0:
+            pLedboard->On(0);
+            return BUTTON_0;
+        case BUTTON_1:
+            pLedboard->On(1);
+            return BUTTON_1;
+        case BUTTON_2:
+            pLedboard->On(2);
+            return BUTTON_2;
+        case BUTTON_3:
+            pLedboard->On(3);
+            return BUTTON_3;
+        default:
+            pLedboard->Off();
+            return RELEASED;
+    }   
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/KeyboardLed/KeyboardLed.h	Sat Jun 13 13:30:27 2020 +0000
@@ -0,0 +1,15 @@
+#ifndef KEYBOARD_LED_H
+    #define KEYBOARD_LED_H
+    #include "Keyboard.h"
+    #include "Ledboard.h"
+    class KeyboardLed
+    {
+        public:
+            KeyboardLed(unsigned char ucColumn);
+            enum KeyboardState eRead(void);
+            Keyboard *pKeyboard;
+            Ledboard *pLedboard;
+    };
+#else
+    #error "This class was definied previously"
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LCD_DISCO_F429ZI.lib	Sat Jun 13 13:30:27 2020 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/ST/code/LCD_DISCO_F429ZI/#dc55a068bc1a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LEDBOARD.lib	Sat Jun 13 13:30:27 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/krzysiek99/code/LEDBOARD/#036ba0fc54a5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TS_DISCO_F429ZI.lib	Sat Jun 13 13:30:27 2020 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/ST/code/TS_DISCO_F429ZI/#4f8b6df8e235
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Jun 13 13:30:27 2020 +0000
@@ -0,0 +1,34 @@
+#include "mbed.h"
+#include "KeyboardLed.h"
+
+LCD_DISCO_F429ZI lcd;
+
+int main()
+{
+    KeyboardLed Touchscreen(0);
+    Ledboard MyLeds(2);
+    while(1)
+    {
+        wait(0.05);
+        Touchscreen.eRead();
+        wait(0.05);
+        switch(Touchscreen.eRead()) 
+        {
+            case BUTTON_0:
+                MyLeds.On(3);
+                break;
+            case BUTTON_1:
+                MyLeds.On(2);
+                break;
+            case BUTTON_2:
+                MyLeds.On(1);
+                break;
+            case BUTTON_3:
+                MyLeds.On(0);
+                break;
+            default:
+                MyLeds.Off();
+                break;
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Jun 13 13:30:27 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file