Riad_ Bajraktarevic
/
Joystick_Led
Aufgabe 1. BusOut Programm
main.cpp@2:ae17974ea4a6, 2020-01-12 (annotated)
- Committer:
- riad
- Date:
- Sun Jan 12 12:29:59 2020 +0000
- Revision:
- 2:ae17974ea4a6
- Parent:
- 1:15d8fa68d1ab
- Child:
- 3:e090a9b08c31
erweitert
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
riad | 0:c8ca3cbede43 | 1 | #include "mbed.h" |
riad | 0:c8ca3cbede43 | 2 | |
riad | 0:c8ca3cbede43 | 3 | BusOut lb(LED1,LED2,LED3,LED4); |
riad | 0:c8ca3cbede43 | 4 | DigitalIn joy(BUTTON1); |
riad | 1:15d8fa68d1ab | 5 | |
riad | 1:15d8fa68d1ab | 6 | |
riad | 1:15d8fa68d1ab | 7 | void lb1 () |
riad | 1:15d8fa68d1ab | 8 | { |
riad | 1:15d8fa68d1ab | 9 | lb = 1; |
riad | 1:15d8fa68d1ab | 10 | wait_ms(100); |
riad | 1:15d8fa68d1ab | 11 | |
riad | 1:15d8fa68d1ab | 12 | for(int i = 0; i<=7; i++) |
riad | 1:15d8fa68d1ab | 13 | { |
riad | 1:15d8fa68d1ab | 14 | lb = lb << 1; |
riad | 1:15d8fa68d1ab | 15 | lb = lb | 1; |
riad | 1:15d8fa68d1ab | 16 | wait_ms(100); |
riad | 1:15d8fa68d1ab | 17 | } |
riad | 2:ae17974ea4a6 | 18 | |
riad | 2:ae17974ea4a6 | 19 | lb = 15; |
riad | 2:ae17974ea4a6 | 20 | wait_ms(100); |
riad | 2:ae17974ea4a6 | 21 | |
riad | 2:ae17974ea4a6 | 22 | for(int i = 0; i<=7; i++) |
riad | 2:ae17974ea4a6 | 23 | { |
riad | 2:ae17974ea4a6 | 24 | lb = lb >> 1; |
riad | 2:ae17974ea4a6 | 25 | lb = lb | 1; |
riad | 2:ae17974ea4a6 | 26 | wait_ms(100); |
riad | 2:ae17974ea4a6 | 27 | } |
riad | 1:15d8fa68d1ab | 28 | } |