Dependencies:   mbed

Fork of mbed_blinky by JINXIN WEI

Files at this revision

API Documentation at this revision

Comitter:
jw17594
Date:
Thu Jan 18 13:42:10 2018 +0000
Parent:
1:96f0f4bee3bb
Commit message:
new blinking pattern

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 96f0f4bee3bb -r 89dfbae54456 main.cpp
--- a/main.cpp	Thu Jan 18 13:37:14 2018 +0000
+++ b/main.cpp	Thu Jan 18 13:42:10 2018 +0000
@@ -3,12 +3,11 @@
 DigitalOut myled(LED1);
 DigitalOut myled2(LED2);
 int main() {
+    int i = 0;
     while(1) {
-        myled = 1;
-        myled2 = 0;
-        wait(0.5);
-        myled = 0;
-        myled2 = 1;
-        wait(0.5);
+        myled = i & 1;
+        myled2 = i & 2;
+        wait(0.25);
+        i++;
     }
 }