Sarah Hachem
/
mbed_blinky_2
4 leds blinking
main.cpp@0:5f4f938dd034, 2018-04-09 (annotated)
- Committer:
- hmsarah
- Date:
- Mon Apr 09 07:19:31 2018 +0000
- Revision:
- 0:5f4f938dd034
4 leds blinking
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hmsarah | 0:5f4f938dd034 | 1 | #include "mbed.h" |
hmsarah | 0:5f4f938dd034 | 2 | |
hmsarah | 0:5f4f938dd034 | 3 | DigitalOut myled(LED1); |
hmsarah | 0:5f4f938dd034 | 4 | DigitalOut myled2(LED2); |
hmsarah | 0:5f4f938dd034 | 5 | DigitalOut myled3(LED3); |
hmsarah | 0:5f4f938dd034 | 6 | DigitalOut myled4(LED4); |
hmsarah | 0:5f4f938dd034 | 7 | |
hmsarah | 0:5f4f938dd034 | 8 | int main() { |
hmsarah | 0:5f4f938dd034 | 9 | printf("Hello World!\n\r"); |
hmsarah | 0:5f4f938dd034 | 10 | while(1) { |
hmsarah | 0:5f4f938dd034 | 11 | myled = 1; |
hmsarah | 0:5f4f938dd034 | 12 | wait(0.2); |
hmsarah | 0:5f4f938dd034 | 13 | myled2 = 1; |
hmsarah | 0:5f4f938dd034 | 14 | myled = 0; |
hmsarah | 0:5f4f938dd034 | 15 | wait(0.2); |
hmsarah | 0:5f4f938dd034 | 16 | myled3 = 1; |
hmsarah | 0:5f4f938dd034 | 17 | myled2 = 0; |
hmsarah | 0:5f4f938dd034 | 18 | wait(0.2); |
hmsarah | 0:5f4f938dd034 | 19 | myled4 = 1; |
hmsarah | 0:5f4f938dd034 | 20 | myled3 = 0; |
hmsarah | 0:5f4f938dd034 | 21 | wait(0.2); |
hmsarah | 0:5f4f938dd034 | 22 | myled3 = 1; |
hmsarah | 0:5f4f938dd034 | 23 | myled4 = 0; |
hmsarah | 0:5f4f938dd034 | 24 | wait(0.2); |
hmsarah | 0:5f4f938dd034 | 25 | myled2 = 1; |
hmsarah | 0:5f4f938dd034 | 26 | myled3 = 0; |
hmsarah | 0:5f4f938dd034 | 27 | wait(0.2); |
hmsarah | 0:5f4f938dd034 | 28 | myled2 = 0; |
hmsarah | 0:5f4f938dd034 | 29 | } |
hmsarah | 0:5f4f938dd034 | 30 | } |