1.Product Introduction
RGB module is a kind of integrated red, green, blue three basic color LED (Light Emitting Diode) module, composed of red, green and blue three independent lamp beads, common has four pins, a public port and three color control ports. We can control the red, green and blue three independent lamp beads separately through the control port, so as to realize the light mixing effect and produce a variety of different color effects.
2.Parameter Specification
Parameter | Value/Representation |
---|---|
Operating voltage | 3.3~5V |
Operating temperature | -30°C~+70°C |
Color of light | RGB three colors |
Peak wavelength | 625nm; 470nm; 530nm |
Control signal | Digital signal |
Size | 3.16cm*2.38cm |
3.Wiring Diagram
RGB Module | UNO |
---|---|
GND | GND |
G | Digital Pin 4 |
R | Digital Pin 5 |
B | Digital Pin 3 |
4.Sample Code
1//Set the RGB pin
2int redpin=5;
3int bluepin=3;
4int greenpin=4;
5int val;
6void setup(){
7 pinMode(redpin,OUTPUT);
8 pinMode(bluepin,OUTPUT);
9 pinMode(greenpin,OUTPUT);
10}
11void loop()
12{
13 for(val=255;val>0;val--){
14 analogWrite(4,val);
15 analogWrite(5,255-val);
16 analogWrite(3,128-val);
17 delay(1);
18 }
19 for(val=0;val<255;val++){
20 analogWrite(4,val);
21 analogWrite(5,255-val);
22 analogWrite(3,128-val);
23 delay(1);
24 }
25}
5.Test Result
After the code is uploaded to the controller board, the RGB light will light up and the display light color will change in the order of cyan and pink.
6.Related Resources
7.Get One Now
B2B Business: info@acebott.com