MiCO MXCHIP
/
Nucleo_blink_led
test
main.cpp@0:ef92a2cc0b89, 2017-03-23 (annotated)
- Committer:
- lizhibo32
- Date:
- Thu Mar 23 12:49:13 2017 +0000
- Revision:
- 0:ef92a2cc0b89
test;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lizhibo32 | 0:ef92a2cc0b89 | 1 | #include "mbed.h" |
lizhibo32 | 0:ef92a2cc0b89 | 2 | |
lizhibo32 | 0:ef92a2cc0b89 | 3 | DigitalOut myled(LED1); |
lizhibo32 | 0:ef92a2cc0b89 | 4 | |
lizhibo32 | 0:ef92a2cc0b89 | 5 | int main() { |
lizhibo32 | 0:ef92a2cc0b89 | 6 | while(1) { |
lizhibo32 | 0:ef92a2cc0b89 | 7 | myled = 1; // LED is ON |
lizhibo32 | 0:ef92a2cc0b89 | 8 | wait(0.2); // 200 ms |
lizhibo32 | 0:ef92a2cc0b89 | 9 | myled = 0; // LED is OFF |
lizhibo32 | 0:ef92a2cc0b89 | 10 | wait(1.0); // 1 sec |
lizhibo32 | 0:ef92a2cc0b89 | 11 | } |
lizhibo32 | 0:ef92a2cc0b89 | 12 | } |