aghmtmppo
Dependencies: LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI
Diff: Keyboard_Led.cpp
- Revision:
- 0:b7f6cb529d74
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Keyboard_Led.cpp Mon Jun 15 17:39:40 2020 +0000 @@ -0,0 +1,26 @@ +#include "Keyboard_Led.h" + +KeyboardLed::KeyboardLed(unsigned char ucColumn) { + pKeyboard = new Keyboard(ucColumn); + pLed = new LedBoard(ucColumn); +} + +enum Read KeyboardLed::eRead() { + switch(pKeyboard -> eRead()) { + case BUTTON_0: + pLed -> On(0); + return BUTTON_0; + case BUTTON_1: + pLed -> On(1); + return BUTTON_1; + case BUTTON_2: + pLed -> On(2); + return BUTTON_2; + case BUTTON_3: + pLed -> On(3); + return BUTTON_3; + default: + pLed -> Off(); + return NO_BUTTON; + } +} \ No newline at end of file