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
Diff: main.cpp
- Revision:
- 0:a5303b7e78e3
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); + } +}