mbed3 zad 4
Dependencies: LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI LEDBOARD BSP_DISCO_F429ZI KEYBOARD
main.cpp@0:a9c26b76c0c1, 2020-06-13 (annotated)
- Committer:
- krzysiek99
- Date:
- Sat Jun 13 13:30:27 2020 +0000
- Revision:
- 0:a9c26b76c0c1
mbed3 zad 4
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
krzysiek99 | 0:a9c26b76c0c1 | 1 | #include "mbed.h" |
krzysiek99 | 0:a9c26b76c0c1 | 2 | #include "KeyboardLed.h" |
krzysiek99 | 0:a9c26b76c0c1 | 3 | |
krzysiek99 | 0:a9c26b76c0c1 | 4 | LCD_DISCO_F429ZI lcd; |
krzysiek99 | 0:a9c26b76c0c1 | 5 | |
krzysiek99 | 0:a9c26b76c0c1 | 6 | int main() |
krzysiek99 | 0:a9c26b76c0c1 | 7 | { |
krzysiek99 | 0:a9c26b76c0c1 | 8 | KeyboardLed Touchscreen(0); |
krzysiek99 | 0:a9c26b76c0c1 | 9 | Ledboard MyLeds(2); |
krzysiek99 | 0:a9c26b76c0c1 | 10 | while(1) |
krzysiek99 | 0:a9c26b76c0c1 | 11 | { |
krzysiek99 | 0:a9c26b76c0c1 | 12 | wait(0.05); |
krzysiek99 | 0:a9c26b76c0c1 | 13 | Touchscreen.eRead(); |
krzysiek99 | 0:a9c26b76c0c1 | 14 | wait(0.05); |
krzysiek99 | 0:a9c26b76c0c1 | 15 | switch(Touchscreen.eRead()) |
krzysiek99 | 0:a9c26b76c0c1 | 16 | { |
krzysiek99 | 0:a9c26b76c0c1 | 17 | case BUTTON_0: |
krzysiek99 | 0:a9c26b76c0c1 | 18 | MyLeds.On(3); |
krzysiek99 | 0:a9c26b76c0c1 | 19 | break; |
krzysiek99 | 0:a9c26b76c0c1 | 20 | case BUTTON_1: |
krzysiek99 | 0:a9c26b76c0c1 | 21 | MyLeds.On(2); |
krzysiek99 | 0:a9c26b76c0c1 | 22 | break; |
krzysiek99 | 0:a9c26b76c0c1 | 23 | case BUTTON_2: |
krzysiek99 | 0:a9c26b76c0c1 | 24 | MyLeds.On(1); |
krzysiek99 | 0:a9c26b76c0c1 | 25 | break; |
krzysiek99 | 0:a9c26b76c0c1 | 26 | case BUTTON_3: |
krzysiek99 | 0:a9c26b76c0c1 | 27 | MyLeds.On(0); |
krzysiek99 | 0:a9c26b76c0c1 | 28 | break; |
krzysiek99 | 0:a9c26b76c0c1 | 29 | default: |
krzysiek99 | 0:a9c26b76c0c1 | 30 | MyLeds.Off(); |
krzysiek99 | 0:a9c26b76c0c1 | 31 | break; |
krzysiek99 | 0:a9c26b76c0c1 | 32 | } |
krzysiek99 | 0:a9c26b76c0c1 | 33 | } |
krzysiek99 | 0:a9c26b76c0c1 | 34 | } |