Button control led blink

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
szqt
Date:
Sun Jul 03 15:07:34 2016 +0000
Parent:
0:c9d8fcdda4d0
Commit message:
fast flash led

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r c9d8fcdda4d0 -r 03f6bcfaacf8 main.cpp
--- a/main.cpp	Fri Feb 21 12:57:03 2014 +0000
+++ b/main.cpp	Sun Jul 03 15:07:34 2016 +0000
@@ -7,7 +7,13 @@
   while(1) {
     if (mybutton == 0) { // Button is pressed
       myled = !myled; // Toggle the LED state
-      wait(0.2); // 200 ms
+      wait(0.1); // 100 ms
+    }
+   else {
+        myled = 1; // LED is ON
+        wait(0.2); // 200 ms
+        myled = 0; // LED is OFF
+        wait(1.0); // 1 sec
     }
   }
 }
diff -r c9d8fcdda4d0 -r 03f6bcfaacf8 mbed.bld
--- a/mbed.bld	Fri Feb 21 12:57:03 2014 +0000
+++ b/mbed.bld	Sun Jul 03 15:07:34 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/ed8466a608b4
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/6c34061e7c34
\ No newline at end of file