RGB LED Module DIP (KY-016) [D007]



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


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


* Specs

Use of full color LED

RGB tricolor current-limiting resistance to prevent burn out

Through the PWM regulating three primary colors mixed with different colors

With a variety of single chip microcomputer interface

Working voltage: 5V

LED drive mode: Yin drive


* Contents

- Connect

R ----- D11

G ----- D10

B ----- D9

- ----- GND


- Key Code

int redPin = 11;

int greenPin = 10;

int bluePin = 9;

 

void setup()

{

 pinMode(redPin, OUTPUT);

 pinMode(greenPin, OUTPUT);

 pinMode(bluePin, OUTPUT); 

}

 

void loop()

{

  setColor(255, 0, 0); // red

  delay(1000);

  setColor(0, 255, 0); // green

  delay(1000);

  setColor(0, 0, 255); // blue

  delay(1000);

  setColor(255, 255, 0); // yellow

  delay(1000); 

  setColor(80, 0, 80); // purple

  delay(1000);

  setColor(0, 255, 255); // aqua

  delay(1000);

}

 

void setColor(int red, int green, int blue)

{

  analogWrite(redPin, red);

  analogWrite(greenPin, green);

  analogWrite(bluePin, blue); 

}

'3) Actuator > LED' 카테고리의 다른 글

Magic Cup Light Module (KY-027) [D020]  (0) 2016.09.18
RGB LED Module SMD (KY-009) [D008]  (0) 2016.09.18
RGB LED (BL-L515) [D006]  (0) 2016.09.18
7 color flash LED Module (KY-034) [D010]  (0) 2016.09.18
2 Color(R,G) LED Module (KY-011) [D005]  (0) 2016.09.18
Posted by RDIoT
|