![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
mbed3 zad 4
Dependencies: LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI LEDBOARD BSP_DISCO_F429ZI KEYBOARD
Diff: KeyboardLed/KeyboardLed.cpp
- Revision:
- 0:a9c26b76c0c1
--- /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