RGB LED Module SMD (KY-009) [D008]



https://www.youtube.com/watch?v=XQI3KhjrwfY


*GitHubhttps://github.com/rdiot/rdiot-d008.git


* Specs

Using 5050 full color LED with max current of 20mA

Forward Voltage : Red 1.80V (2.4 max), Green,Blue 2.8V (3.6V)

RGB trichromatic limiting resistor to prevent burnout

through the PWM adjusting three primary colors can be mixed to obtain different colors

with a variety of single-chip interface

Operating voltage: 5V

LED drive mode: common cathode driver


* Contents

- Connect

B ----- D9

R ----- D11

G ----- D10

- ----- 3.3V or 5V 


- Key Code

int B = 9; // OUTPUT PIN blue

int R = 11; // OUTPUT PIN red

int G = 10; // OUTPUT PIN green

 

void setup()

{

 Serial.begin(115200); 

 Serial.println("Arduino Examples - RGB LED");

 pinMode(R, OUTPUT);

 pinMode(G, OUTPUT);

 pinMode(B, OUTPUT);

}

 

void loop()

 // RED

 digitalWrite(R, LOW);

 digitalWrite(G, HIGH);

 digitalWrite(B, HIGH);

 delay(1000);

 

 // GREEN

 digitalWrite(R, HIGH);

 digitalWrite(G, LOW);

 delay(1000);

 

 // BLUE

 digitalWrite(G, HIGH);

 digitalWrite(B, LOW);

 delay(1000);

 

 // RED + GREEN = YELLOW

 digitalWrite(B, HIGH);

 digitalWrite(R, LOW);

 digitalWrite(G, LOW);

 delay(1000);

 

 // RED + BLUE = MAGENTA

 digitalWrite(B, LOW);

 digitalWrite(R, LOW);

 digitalWrite(G, HIGH);

 delay(1000);

 

 // GREEN + BLUE = CYON

 digitalWrite(B, LOW);

 digitalWrite(R, HIGH);

 digitalWrite(G, LOW);

 delay(1000);

 

 // RED + GREEN + BLUE = WHITE

 digitalWrite(B, LOW);

 digitalWrite(R, LOW);

 digitalWrite(G, LOW);

 delay(1000);

 

 // ALL OFF

 digitalWrite(B, HIGH);

 digitalWrite(R, HIGH);

 digitalWrite(G, HIGH);

 delay(1000);

}

Posted by RDIoT

댓글을 달아 주세요