disminuye la frecuencia de parpadeo cuando se pulsa un botón, cuando llega a cierto limite de pulsaciones, el sistema regresa al inicio.

Dependencies:   DebouncedIn mbed

main.cpp

Committer:
lopjohn_26
Date:
2014-03-31
Revision:
0:7405379d206b

File content as of revision 0:7405379d206b:

#include "mbed.h"
#include "DebouncedIn.h"


DigitalOut myled(LED1);
DebouncedIn buttom(PTC6);


float TR=0.1;

int main() {
    
    while(1) {
        
        if(buttom.falling()){
        TR=TR+0.2;
                            }
        
                 
        myled = 1;
        wait(TR);
        myled = 0;
        wait(TR);
    
        if(TR>=3){
        TR=0.1;
                 }
    
    }
}