Raziel Lopez
/
frdm_K64_ON_OFFsw
ON OFF LED
Diff: main.cpp
- Revision:
- 0:100c914c126b
diff -r 000000000000 -r 100c914c126b main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat May 26 14:51:59 2018 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "Led_Colores.h" + +DigitalIn sw3(SW3); //Declaramos switch 2 +DigitalIn sw2(SW2); //Declaramos switch3 + +int main() +{ + ColorLed(BLACK); + int bandera=0; + while (true) { + if(!sw2 && sw3){ //sw2 se niega porque al apretarlo regresa un 0 + ColorLed(RED); //Prende LED rojo + } + else if(!sw3 && sw2){ //sw3 se niega porque al apretarlo regresa un 0 + ColorLed(BLACK); //Prende LED Azul + wait(1.0f); + ColorLed(GREEN); + } + + + wait(0.2f); + } +} \ No newline at end of file