pulsador que retarda el tiempo de un pulso que enciende un led.

Dependencies:   DebouncedIn mbed

Files at this revision

API Documentation at this revision

Comitter:
walterg
Date:
Thu Apr 03 04:07:35 2014 +0000
Commit message:
tarea #1

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DebouncedIn.lib	Thu Apr 03 04:07:35 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/cmorab/code/DebouncedIn/#dc1131de43e8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Apr 03 04:07:35 2014 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+#include "stdio.h"
+#include "DebouncedIn.h" 
+ 
+DigitalOut led(LED1);
+ 
+DebouncedIn pulsador(PTC5);
+ 
+float t;  
+int main() {
+    while(1) {
+        led=!led;
+        if  (pulsador.falling()){
+            if (t+0.1<1000)
+                t=t+0.1;
+            else
+                t=0.1;
+        }
+        wait(t);
+    }
+}
+    
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Apr 03 04:07:35 2014 +0000
@@ -0,0 +1,1 @@
+http://world3.dev.mbed.org/users/mbed_official/code/mbed/builds/824293ae5e43
\ No newline at end of file