Gerardo Carmona
/
03_Siete_Colores_Led_RGB
This program combines the RGB colors to create 7 diferent combinations
main.cpp
- Committer:
- gcarmonar
- Date:
- 2013-10-09
- Revision:
- 0:1abdccc5994d
File content as of revision 0:1abdccc5994d:
#include "mbed.h" DigitalOut bled(LED1); DigitalOut gled(LED2); DigitalOut rled(LED3); int main() { bled = 1; gled = 1; rled = 1; while(1) { // Azul bled = 0; rled = 1; gled = 1; wait(0.5); // Verde bled = 1; gled = 0; wait(0.5); // Rojo gled = 1; rled = 0; wait(0.5); // Verde + Rojo = Amarillo gled = 0; wait(0.5); // Verde + Azul = Cyan rled = 1; bled = 0; wait(0.5); // Azul + Rojo = Rosa gled = 1; rled = 0; wait(0.5); // Azul + Rojo + Verde = Blanco gled = 0; wait(0.5); } }