Tarea1-Versión1. Uso de un botón para disminuir el tiempo de encendido y apagado de un LED.
Dependencies: DebouncedIn mbed
Fork of Tarea1-V1 by
Revision 0:a5303b7e78e3, committed 2014-03-28
- Comitter:
- juniorACA
- Date:
- Fri Mar 28 21:09:22 2014 +0000
- Commit message:
- Versi?n 1
Changed in this revision
diff -r 000000000000 -r a5303b7e78e3 DebouncedIn.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DebouncedIn.lib Fri Mar 28 21:09:22 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/cmorab/code/DebouncedIn/#dc1131de43e8
diff -r 000000000000 -r a5303b7e78e3 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Mar 28 21:09:22 2014 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" +#include "DebouncedIn.h" + + +DebouncedIn mybutton(PTC12); +DigitalOut myled(LED1); + +float delay = 0.01; +int main() +{ + while (1) { + if (mybutton.falling()) + { + delay += 0.01; + } + myled = !myled; + wait(delay); + } +}
diff -r 000000000000 -r a5303b7e78e3 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Mar 28 21:09:22 2014 +0000 @@ -0,0 +1,1 @@ +http://world3.dev.mbed.org/users/mbed_official/code/mbed/builds/824293ae5e43 \ No newline at end of file