Tarea1-Versión2. Uso de un botón para disminuir el tiempo de encendido y apagado de un LED con una propuesta de código alternativa.

Dependencies:   Debounced mbed

Fork of Tarea1-V2 by junior andres calle acevedo

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "DebouncedIn.h"
00003 
00004 DebouncedIn puls(PTC12);
00005 DigitalOut myled(LED1);
00006 
00007 float k=0;
00008 float t=0.2;
00009 
00010 int main() {
00011     while(1) {
00012         if(puls.falling()){
00013             ++k;
00014             t=0.2*(k*1.1);
00015             }
00016         myled = !myled;
00017         wait(t);
00018         
00019     }
00020 }