a
Dependencies: BSP_DISCO_F429ZI LCD_DISCO_F429ZI TS_DISCO_F429ZI mbed
Fork of Mbed1d-2 by
main.cpp@0:9b028a92ac8a, 2017-04-24 (annotated)
- Committer:
- pbl96
- Date:
- Mon Apr 24 15:26:38 2017 +0000
- Revision:
- 0:9b028a92ac8a
Mbed
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pbl96 | 0:9b028a92ac8a | 1 | #include "mbed.h" |
pbl96 | 0:9b028a92ac8a | 2 | #include "KeyboardTsLcd.h" |
pbl96 | 0:9b028a92ac8a | 3 | |
pbl96 | 0:9b028a92ac8a | 4 | int main() { |
pbl96 | 0:9b028a92ac8a | 5 | KeyboardTSLcd Keyboard(1); |
pbl96 | 0:9b028a92ac8a | 6 | LedLcd MyLed(3); |
pbl96 | 0:9b028a92ac8a | 7 | |
pbl96 | 0:9b028a92ac8a | 8 | while(1) { |
pbl96 | 0:9b028a92ac8a | 9 | switch(Keyboard.eRead()) { |
pbl96 | 0:9b028a92ac8a | 10 | |
pbl96 | 0:9b028a92ac8a | 11 | case BUTTON_0: |
pbl96 | 0:9b028a92ac8a | 12 | MyLed.On(3); |
pbl96 | 0:9b028a92ac8a | 13 | break; |
pbl96 | 0:9b028a92ac8a | 14 | |
pbl96 | 0:9b028a92ac8a | 15 | case BUTTON_1: |
pbl96 | 0:9b028a92ac8a | 16 | MyLed.On(2); |
pbl96 | 0:9b028a92ac8a | 17 | break; |
pbl96 | 0:9b028a92ac8a | 18 | |
pbl96 | 0:9b028a92ac8a | 19 | case BUTTON_2: |
pbl96 | 0:9b028a92ac8a | 20 | MyLed.On(1); |
pbl96 | 0:9b028a92ac8a | 21 | break; |
pbl96 | 0:9b028a92ac8a | 22 | |
pbl96 | 0:9b028a92ac8a | 23 | case BUTTON_3: |
pbl96 | 0:9b028a92ac8a | 24 | MyLed.On(0); |
pbl96 | 0:9b028a92ac8a | 25 | break; |
pbl96 | 0:9b028a92ac8a | 26 | |
pbl96 | 0:9b028a92ac8a | 27 | default : |
pbl96 | 0:9b028a92ac8a | 28 | MyLed.On(4); |
pbl96 | 0:9b028a92ac8a | 29 | break; |
pbl96 | 0:9b028a92ac8a | 30 | |
pbl96 | 0:9b028a92ac8a | 31 | } |
pbl96 | 0:9b028a92ac8a | 32 | wait(0.1); |
pbl96 | 0:9b028a92ac8a | 33 | |
pbl96 | 0:9b028a92ac8a | 34 | } |
pbl96 | 0:9b028a92ac8a | 35 | |
pbl96 | 0:9b028a92ac8a | 36 | } |