mbed3
Dependencies: LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI
Diff: KeyboardLed.cpp
- Revision:
- 2:aebba5ba280a
- Parent:
- 1:a89a995856ce
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/KeyboardLed.cpp Mon May 25 11:17:21 2020 +0000 @@ -0,0 +1,26 @@ +#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