
Mbed1-StanislawMaciejewski
Dependencies: LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI
KeyboardTsLcd.cpp@0:6e3505b453da, 2020-05-18 (annotated)
- Committer:
- stanmac
- Date:
- Mon May 18 19:57:01 2020 +0000
- Revision:
- 0:6e3505b453da
Mbed1-StanislawMaciejewski
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
stanmac | 0:6e3505b453da | 1 | #include "mbed.h" |
stanmac | 0:6e3505b453da | 2 | #include "KeyboardTsLcd.h" |
stanmac | 0:6e3505b453da | 3 | #include "Led_Lcd.h" |
stanmac | 0:6e3505b453da | 4 | #include "Keyboard_Ts.h" |
stanmac | 0:6e3505b453da | 5 | |
stanmac | 0:6e3505b453da | 6 | KeyboardTsLcd::KeyboardTsLcd(unsigned char _ucColumn){ |
stanmac | 0:6e3505b453da | 7 | pKeyboard = new KeyboardTs(_ucColumn); |
stanmac | 0:6e3505b453da | 8 | pLed = new LedLcd(_ucColumn); |
stanmac | 0:6e3505b453da | 9 | } |
stanmac | 0:6e3505b453da | 10 | |
stanmac | 0:6e3505b453da | 11 | enum KeyboardState KeyboardTsLcd::eRead(){ |
stanmac | 0:6e3505b453da | 12 | switch(pKeyboard->eRead()){ |
stanmac | 0:6e3505b453da | 13 | case BUTTON_0: |
stanmac | 0:6e3505b453da | 14 | pLed->On(0); |
stanmac | 0:6e3505b453da | 15 | return BUTTON_0; |
stanmac | 0:6e3505b453da | 16 | case BUTTON_1: |
stanmac | 0:6e3505b453da | 17 | pLed->On(1); |
stanmac | 0:6e3505b453da | 18 | return BUTTON_1; |
stanmac | 0:6e3505b453da | 19 | case BUTTON_2: |
stanmac | 0:6e3505b453da | 20 | pLed->On(2); |
stanmac | 0:6e3505b453da | 21 | return BUTTON_2; |
stanmac | 0:6e3505b453da | 22 | case BUTTON_3: |
stanmac | 0:6e3505b453da | 23 | pLed->On(3); |
stanmac | 0:6e3505b453da | 24 | return BUTTON_3; |
stanmac | 0:6e3505b453da | 25 | default: |
stanmac | 0:6e3505b453da | 26 | pLed->On(4); |
stanmac | 0:6e3505b453da | 27 | return RELEASED; |
stanmac | 0:6e3505b453da | 28 | } |
stanmac | 0:6e3505b453da | 29 | } |