Mbed cz.1 cwiczenie ostatnie (2d2)
Dependencies: LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI
Diff: KeyboardTsLcd.cpp
- Revision:
- 0:036c13c6cbb6
diff -r 000000000000 -r 036c13c6cbb6 KeyboardTsLcd.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/KeyboardTsLcd.cpp Mon May 18 05:54:39 2020 +0000 @@ -0,0 +1,31 @@ +#include "KeyboardTsLcd.h" + +KeyboardTsLcd::KeyboardTsLcd(unsigned char _ucColumn){ + pKeyboard = new KeyboardTs(_ucColumn); + pLed = new LedLcd(_ucColumn); +} + +enum KeyboardState KeyboardTsLcd::eRead(){ + switch(pKeyboard->eRead()){ + case BUTTON_0: + pLed->On(0); + return BUTTON_0; + break; + case BUTTON_1: + pLed->On(1); + return BUTTON_1; + break; + case BUTTON_2: + pLed->On(2); + return BUTTON_2; + break; + case BUTTON_3: + pLed->On(3); + return BUTTON_3; + break; + default: + pLed->On(4); + return RELASED; + break; + } +} \ No newline at end of file