//Your Task Is To Blink Color White Once
//Color Red 2 times
//Color Green 3 times...
//Color Blue 4 times
//Color Yellow Viole Cyan Once...
//Then Sa End White continue to on every second
//Make Your Code As Short As Possible
/* RGB Light Color Mixing Facts .. .
Red + Green + Blue = White ;
Red + Green = Yellow ;
Green + Blue = Cyan ;
Blue + Red = Violet ;
But it Depends on the intensity of light it can create more colors ...
PIN 1 is BLUE
PIN 2 is GREEN
PIN 3 is RED
*/
int time = 500;
void setup() {
// put your setup code here, to run once:
pinMode(1, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
mix();
}
void mix(){
digitalWrite(3, HIGH); /*
digitalWrite(2, HIGH);
digitalWrite(1, HIGH);
*/
}
void rgb(){
digitalWrite(3, HIGH); //Red On
delay(time);
digitalWrite(3, LOW); //Red Off
delay(time);
digitalWrite(2, HIGH); //Green On
delay(time);
digitalWrite(2, LOW); //Green Off
delay(time);
digitalWrite(1, HIGH); //Blue On
delay(time);
digitalWrite(1, LOW); //Blue Off
delay(time);
}
//Your Task Is To Blink The Led for only 5 times every second then Stop ...
//Make Your Code As Short As Possible