WizziLab
/
Nucleo_blink_led
Blinks the nucleo LED.
Diff: main.cpp
- Revision:
- 4:c7d265a01e7e
- Parent:
- 2:b60cb847489c
--- a/main.cpp Thu Nov 06 10:13:20 2014 +0000 +++ b/main.cpp Mon Jan 04 15:46:49 2016 +0000 @@ -1,12 +1,16 @@ #include "mbed.h" +#include "rtos.h" + DigitalOut myled(LED1); int main() { - while(1) { + while(true) + { + // Wait to avoid beeing stuck in loop myled = 1; // LED is ON - wait(0.2); // 200 ms + Thread::wait(200); // 200 ms myled = 0; // LED is OFF - wait(1.0); // 1 sec + Thread::wait(1000); // 1 sec } }