pulsador que retarda el tiempo de un pulso que enciende un led.
Dependencies: DebouncedIn mbed
Revision 0:611bdfe9022f, committed 2014-04-03
- Comitter:
- walterg
- Date:
- Thu Apr 03 04:07:35 2014 +0000
- Commit message:
- tarea #1
Changed in this revision
diff -r 000000000000 -r 611bdfe9022f DebouncedIn.lib --- /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
diff -r 000000000000 -r 611bdfe9022f main.cpp --- /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
diff -r 000000000000 -r 611bdfe9022f mbed.bld --- /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