disminuye la frecuencia de parpadeo cuando se pulsa un botón, cuando llega a cierto limite de pulsaciones, el sistema regresa al inicio.

Dependencies:   DebouncedIn mbed

Files at this revision

API Documentation at this revision

Comitter:
lopjohn_26
Date:
Mon Mar 31 17:05:23 2014 +0000
Commit message:
disminuye la frecuencia de parpadeo al oprimir un bot?n, cuando llega a un limite de pulsaciones el sistema regresa al estado inicial.

Changed in this revision

DebouncedIn.lib Show annotated file Show diff for this revision Revisions of this file
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 000000000000 -r 7405379d206b DebouncedIn.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DebouncedIn.lib	Mon Mar 31 17:05:23 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/cmorab/code/DebouncedIn/#dc1131de43e8
diff -r 000000000000 -r 7405379d206b main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Mar 31 17:05:23 2014 +0000
@@ -0,0 +1,30 @@
+#include "mbed.h"
+#include "DebouncedIn.h"
+
+
+DigitalOut myled(LED1);
+DebouncedIn buttom(PTC6);
+
+
+float TR=0.1;
+
+int main() {
+    
+    while(1) {
+        
+        if(buttom.falling()){
+        TR=TR+0.2;
+                            }
+        
+                 
+        myled = 1;
+        wait(TR);
+        myled = 0;
+        wait(TR);
+    
+        if(TR>=3){
+        TR=0.1;
+                 }
+    
+    }
+}
diff -r 000000000000 -r 7405379d206b mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Mar 31 17:05:23 2014 +0000
@@ -0,0 +1,1 @@
+http://world3.dev.mbed.org/users/mbed_official/code/mbed/builds/824293ae5e43
\ No newline at end of file