
ON OFF LED
main.cpp
- Committer:
- RazielLopez
- Date:
- 2018-05-26
- Revision:
- 0:100c914c126b
File content as of revision 0:100c914c126b:
#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); } }