The example program for mbed pin-compatible platforms - Blink the LED's alternately.
Fork of mbed_blinky by
main.cpp@1:f54cf65a063e, 2014-01-31 (annotated)
- Committer:
- mja054
- Date:
- Fri Jan 31 05:55:49 2014 +0000
- Revision:
- 1:f54cf65a063e
- Parent:
- 0:7dec7e9ac085
- Child:
- 2:e73b698f2566
Alternately blink red and green LED.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dan | 0:7dec7e9ac085 | 1 | #include "mbed.h" |
dan | 0:7dec7e9ac085 | 2 | |
mja054 | 1:f54cf65a063e | 3 | DigitalOut green(LED1); |
mja054 | 1:f54cf65a063e | 4 | DigitalOut red(LED2); |
dan | 0:7dec7e9ac085 | 5 | |
dan | 0:7dec7e9ac085 | 6 | int main() { |
dan | 0:7dec7e9ac085 | 7 | while(1) { |
mja054 | 1:f54cf65a063e | 8 | red = 1; |
mja054 | 1:f54cf65a063e | 9 | green = 0; |
dan | 0:7dec7e9ac085 | 10 | wait(0.2); |
mja054 | 1:f54cf65a063e | 11 | red = 0; |
mja054 | 1:f54cf65a063e | 12 | green = 1; |
dan | 0:7dec7e9ac085 | 13 | wait(0.2); |
dan | 0:7dec7e9ac085 | 14 | } |
dan | 0:7dec7e9ac085 | 15 | } |