Martin Werluschnig
/
mbed_blinky_KnightRider
mbed_blinky_KnightRider
main.cpp@0:cca4a04f9674, 2018-11-15 (annotated)
- Committer:
- martwerl
- Date:
- Thu Nov 15 18:02:39 2018 +0000
- Revision:
- 0:cca4a04f9674
mbed_blinky_KnightRider
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
martwerl | 0:cca4a04f9674 | 1 | #include "mbed.h" |
martwerl | 0:cca4a04f9674 | 2 | |
martwerl | 0:cca4a04f9674 | 3 | DigitalOut myled(LED1); |
martwerl | 0:cca4a04f9674 | 4 | DigitalOut myled2(LED2,1); |
martwerl | 0:cca4a04f9674 | 5 | DigitalOut myled3(LED3,1); |
martwerl | 0:cca4a04f9674 | 6 | DigitalOut myled4(LED4,1); |
martwerl | 0:cca4a04f9674 | 7 | |
martwerl | 0:cca4a04f9674 | 8 | |
martwerl | 0:cca4a04f9674 | 9 | int main() { |
martwerl | 0:cca4a04f9674 | 10 | while(1) { |
martwerl | 0:cca4a04f9674 | 11 | printf("Hello World!\r\n"); |
martwerl | 0:cca4a04f9674 | 12 | myled.write(1); |
martwerl | 0:cca4a04f9674 | 13 | wait(0.2); |
martwerl | 0:cca4a04f9674 | 14 | myled2.write(1); |
martwerl | 0:cca4a04f9674 | 15 | wait(0.2); |
martwerl | 0:cca4a04f9674 | 16 | myled = 0; |
martwerl | 0:cca4a04f9674 | 17 | wait(0.2); |
martwerl | 0:cca4a04f9674 | 18 | myled3.write(1); |
martwerl | 0:cca4a04f9674 | 19 | wait(0.2); |
martwerl | 0:cca4a04f9674 | 20 | myled2 = 0; |
martwerl | 0:cca4a04f9674 | 21 | wait(0.2); |
martwerl | 0:cca4a04f9674 | 22 | myled4.write(1); |
martwerl | 0:cca4a04f9674 | 23 | wait(0.2); |
martwerl | 0:cca4a04f9674 | 24 | myled3 = 0; |
martwerl | 0:cca4a04f9674 | 25 | wait(0.2); |
martwerl | 0:cca4a04f9674 | 26 | myled4 = 0; |
martwerl | 0:cca4a04f9674 | 27 | myled3.write(1); |
martwerl | 0:cca4a04f9674 | 28 | wait(0.2); |
martwerl | 0:cca4a04f9674 | 29 | myled2.write(1); |
martwerl | 0:cca4a04f9674 | 30 | wait(0.2); |
martwerl | 0:cca4a04f9674 | 31 | myled3 = 0; |
martwerl | 0:cca4a04f9674 | 32 | wait(0.2); |
martwerl | 0:cca4a04f9674 | 33 | myled.write(1); |
martwerl | 0:cca4a04f9674 | 34 | wait(0.2); |
martwerl | 0:cca4a04f9674 | 35 | myled2 = 0; |
martwerl | 0:cca4a04f9674 | 36 | wait(0.2); |
martwerl | 0:cca4a04f9674 | 37 | myled = 0; |
martwerl | 0:cca4a04f9674 | 38 | |
martwerl | 0:cca4a04f9674 | 39 | } |
martwerl | 0:cca4a04f9674 | 40 | } |