
Test example project for 3 blinking leds
Diff: main.cpp
- Revision:
- 11:dabb958b9b9f
- Parent:
- 8:bb09890333fe
--- a/main.cpp Sat Aug 20 00:00:05 2016 +0100 +++ b/main.cpp Fri Mar 01 13:00:20 2019 +0000 @@ -1,13 +1,23 @@ #include "mbed.h" + DigitalOut led1(LED1); +DigitalOut led2(LED2); +DigitalOut led3(LED3); -// main() runs in its own thread in the OS -// (note the calls to Thread::wait below for delays) int main() { - while (true) { - led1 = !led1; - Thread::wait(500); + while(1) { + led1 = 0; + wait(1); + led1 = 1; + wait(1); + led2 = 0; + wait(1); + led2 = 1; + wait(1); + led3 = 0; + wait(1); + led3 = 1; + wait(1); } } -