Basic example showing how to blink the LED present on the board.
Dependencies: mbed
main.cpp@0:455505e7e985, 2015-09-18 (annotated)
- Committer:
- bcostm
- Date:
- Fri Sep 18 16:38:57 2015 +0000
- Revision:
- 0:455505e7e985
Initial version.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bcostm | 0:455505e7e985 | 1 | #include "mbed.h" |
bcostm | 0:455505e7e985 | 2 | |
bcostm | 0:455505e7e985 | 3 | DigitalOut myled(LED1); |
bcostm | 0:455505e7e985 | 4 | |
bcostm | 0:455505e7e985 | 5 | int main() { |
bcostm | 0:455505e7e985 | 6 | while(1) { |
bcostm | 0:455505e7e985 | 7 | myled = 1; // LED is ON |
bcostm | 0:455505e7e985 | 8 | wait(0.2); // 200 ms |
bcostm | 0:455505e7e985 | 9 | myled = 0; // LED is OFF |
bcostm | 0:455505e7e985 | 10 | wait(1.0); // 1 sec |
bcostm | 0:455505e7e985 | 11 | } |
bcostm | 0:455505e7e985 | 12 | } |