Jan Martin
/
actividad_1
UNAL_Procesadores Actividad 1
Diff: main.cpp
- Revision:
- 0:7f5c273fe35a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Oct 09 17:21:15 2019 +0000 @@ -0,0 +1,52 @@ +#include "mbed.h" + +DigitalOut red(LED1); //red +DigitalOut green(LED2); //Green +DigitalOut blue(LED3); //Blue + +int main() { + + // Reset all LEDs to off (LEDs are low-active) + red = 1; + green = 1; + blue = 1; + + while(1) { + + //light red LED 1s + red = 0; + wait(1); + red = 1; + + //light green LED 1s + green = 0; + wait(1); + green = 1; + + //light blue LED 1s + blue = 0; + wait(1); + blue = 1; + + //light red and green (=yellow) LEDs 1s + red = 0; + green = 0; + wait(1); + red = 1; + green = 1; + + //light red and blue (=magenta) LEDs 1s + red = 0; + blue = 0; + wait(1); + red = 1; + blue = 1; + + //light blue and green (=cyan) LEDs 1s + blue = 0; + green = 0; + wait(1); + blue = 1; + green = 1; + } +}