RGB LED

SRJT09104

Jugaadu is given a task to arrange an inter-college dancing competition and other events in his college. For the preparation of the stage, he is thinking of putting a colour lighting effect that will turn on different colour lights periodically. Can you help him to complete this task ?

  1. Arduino UNO
  2. Arduino UNO Cable (A to B)
  3. RGB LED
  4. Jumper Wires

    int RED_PIN = 11;
int GREEN_PIN = 10;
int BLUE_PIN = 9;

void setup()
{
Serial.begin(9600);
pinMode(RED_PIN, OUTPUT);
pinMode(GREEN_PIN, OUTPUT);
pinMode(BLUE_PIN, OUTPUT);
}

void loop()
{
digitalWrite(RED_PIN, HIGH);
digitalWrite(GREEN_PIN, LOW);
digitalWrite(BLUE_PIN, LOW);
delay(2000);

digitalWrite(RED_PIN, LOW);
digitalWrite(GREEN_PIN, HIGH);
digitalWrite(BLUE_PIN, LOW);
delay(2000);

digitalWrite(RED_PIN, LOW);
digitalWrite(GREEN_PIN, LOW);
digitalWrite(BLUE_PIN, HIGH);
delay(2000);