ticker and while

Dependencies:   mbed

main.cpp

Committer:
aldomarez
Date:
2018-10-17
Revision:
0:69f37b9d5c07

File content as of revision 0:69f37b9d5c07:

#include "mbed.h"  
Ticker  flipper;
DigitalOut  encendido(D4);  
DigitalOut  apagado(D5);  
DigitalOut  parpadeo(D6); 
DigitalOut  motor(LED2);  
void  flip()  {  
motor  =  !motor;
encendido = !encendido; 
apagado=!apagado; 
} 
int  main()  {
apagado=1;
encendido = 0;
motor = 1;
parpadeo=1;

flipper.attach(&flip, 2.0);

while(1)  {
    parpadeo  =  !parpadeo;
    wait(0.2);
    }
}