ON OFF LED

Dependencies:   mbed

Committer:
RazielLopez
Date:
Sat May 26 14:51:59 2018 +0000
Revision:
0:100c914c126b
estable

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RazielLopez 0:100c914c126b 1 #include "mbed.h"
RazielLopez 0:100c914c126b 2 #include "Led_Colores.h"
RazielLopez 0:100c914c126b 3
RazielLopez 0:100c914c126b 4 DigitalOut ledR(LED_RED);
RazielLopez 0:100c914c126b 5 DigitalOut ledB(LED_BLUE);
RazielLopez 0:100c914c126b 6 DigitalOut ledG(LED_GREEN);
RazielLopez 0:100c914c126b 7
RazielLopez 0:100c914c126b 8 void ColorLed(int c){
RazielLopez 0:100c914c126b 9
RazielLopez 0:100c914c126b 10
RazielLopez 0:100c914c126b 11 if(c & BIT_RED )
RazielLopez 0:100c914c126b 12 ledR=on;
RazielLopez 0:100c914c126b 13 else
RazielLopez 0:100c914c126b 14 ledR= off;
RazielLopez 0:100c914c126b 15 if(c & BIT_GREEN)
RazielLopez 0:100c914c126b 16 ledG=on;
RazielLopez 0:100c914c126b 17 else
RazielLopez 0:100c914c126b 18 ledG=off;
RazielLopez 0:100c914c126b 19 if(c & BIT_BLUE)
RazielLopez 0:100c914c126b 20 ledB=on;
RazielLopez 0:100c914c126b 21 else
RazielLopez 0:100c914c126b 22 ledB=off;
RazielLopez 0:100c914c126b 23 }