Tarea1-Versión3. Uso de 3 botones, al presionar el botón 1 el tiempo de encendido y apagado del LED disminuye, al presionar el botón 2 el tiempo de encendido y apagado del LED aumenta, al presionar el botón 3 se lleva el LED a un estado inicial (Reset)

Dependencies:   Debounced mbed

Fork of Tarea1-V3 by junior andres calle acevedo

Files at this revision

API Documentation at this revision

Comitter:
juniorACA
Date:
Tue Apr 08 17:42:09 2014 +0000
Commit message:
Tarea1-V3

Changed in this revision

Debounced.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 f8fe2133f19c Debounced.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Debounced.lib	Tue Apr 08 17:42:09 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/WarwickRacing/code/Debounced/#8992c13bbb9b
diff -r 000000000000 -r f8fe2133f19c main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Apr 08 17:42:09 2014 +0000
@@ -0,0 +1,36 @@
+
+#include "mbed.h"
+#include "DebouncedIn.h"
+
+DebouncedIn puls1(PTC12);
+DebouncedIn puls2(PTC13);
+DebouncedIn puls3(PTC16);
+DigitalOut myled(LED1);
+
+float k=0;
+float t=0.01;
+float r=0;
+
+int main() {
+    while(1) {
+        if(puls1.falling()){
+            ++k;
+            t=0.01*(k*1.1);
+           }
+        myled = !myled;
+        wait(t); 
+        if (puls2.falling()){
+            --k;
+            t=0.01*(k*1.1);}
+        myled=!myled;
+        wait(t); 
+        if(puls3.falling()){
+          k=1;
+          t=0.01;
+           }
+        myled=!myled;
+        wait(t);
+        }
+            
+}
+
diff -r 000000000000 -r f8fe2133f19c mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Apr 08 17:42:09 2014 +0000
@@ -0,0 +1,1 @@
+http://world3.dev.mbed.org/users/mbed_official/code/mbed/builds/824293ae5e43
\ No newline at end of file