![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
JOSE ALBERTO RUIZ, SEBASTIAN PELAEZ LENTEJA // Programa que incrementa en 10% el periodo de una señal por medio de pulsaciones, El pulsador está entre el pin PTC11 y GND / This program increases 10% the period of a square signal via keystrokes.Button is connected between pin PTC11 and GND // JOSE RUIZ, UNALMED 2014
Dependencies: DebouncedIn mbed
Revision 0:574647369d62, committed 2014-03-26
- Comitter:
- jaruiz
- Date:
- Wed Mar 26 05:00:53 2014 +0000
- Commit message:
- Tarea 1 Procesadores, programa que incrementa en 10% el periodo de una se?al cuadrada que enciende el led por medio de pulsaciones, el pulsador est? conectado entre pines PTC11 y GND /This program increases 10% the signal period by keystrokes /UNAL
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DebouncedIn.lib Wed Mar 26 05:00:53 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 Wed Mar 26 05:00:53 2014 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" +#include "stdio.h" +#include "DebouncedIn.h" + +DigitalOut led(LED1); + +DebouncedIn pulsador(PTC11); + +float t; +int main() { + while(1) { + led=!led; + if (pulsador.falling()){ + if (t+0.1<1) + 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 Wed Mar 26 05:00:53 2014 +0000 @@ -0,0 +1,1 @@ +http://world3.dev.mbed.org/users/mbed_official/code/mbed/builds/824293ae5e43 \ No newline at end of file