RGB stands for Red,Green,Blue. RGB led there are three cathode and one common anode.Each cathode is connected to a single color(red,green,blue) .Different color are produce in a single led.
Today we are going to blink led with the 3 different color serially.
Components Required
- RGB led
- computer
- resister[330 ohms]
- Cable connector
for this,first of all we need to arrange the hardware components
Open the arduino programming software and start programming
int red=13;// define the pins
int green=12;
int blue = 11;
Void Setup()
{ pinMode(red,OUTPUT);// initialized the output and input pinspinMode(green,OUTPUT);
pinMode(blue,OUTPUT);
}
Void loop ()
{digitalWrite(13,HIGH);//red high for 50ns
delay(50);
digitalWrite(12,HIGH);//green high for 50ns
delay(50);
digitalWrite(11,HIGH);//blue high for 50ns
delay(50);
}
upload the program into Arduino using usb cable and enjoy with the output.