Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 1:bf9d382dd610
- Parent:
- 0:c9d8fcdda4d0
diff -r c9d8fcdda4d0 -r bf9d382dd610 main.cpp
--- a/main.cpp Fri Feb 21 12:57:03 2014 +0000
+++ b/main.cpp Fri May 05 15:40:01 2017 +0000
@@ -4,11 +4,16 @@
DigitalOut myled(LED1);
int main() {
+ bool old=1;
while(1) {
- if (mybutton == 0) { // Button is pressed
+ if (mybutton == 0 && old) { // Button is pressed
myled = !myled; // Toggle the LED state
- wait(0.2); // 200 ms
+ old=0;
+ //wait(0.2); // 200 ms
}
+ if(mybutton && !old)
+ {
+ old=1;
+ }
}
}
-
\ No newline at end of file