Test example project for 3 blinking leds

Files at this revision

API Documentation at this revision

Comitter:
jarekp
Date:
Fri Mar 01 13:00:20 2019 +0000
Parent:
10:c4bec1c9b715
Commit message:
Publish testing example Mbed OS blink

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- 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);
     }
 }
-