2 Color(R,G) LED Module (KY-011) [D005]



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


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


* Specs

The Keyes 2 Color LED Module is a simple yet effective LED that is compatible with Arduino systems.  


Specs:

Material: FR4

Length: 35mm

Width: 15mm

Height: 13mm

Weight: 1.35g

Operating Voltage: 5v DC



* Contents

- Connect

- ----- GND

R ----- D11 (red)

G ----- D10 (green)


- Key Code

int R = 11; // OUTPUT PIN red

int G = 10; // OUTPUT PIN green

 

void setup()

{

 Serial.begin(115200); 

 pinMode(R, OUTPUT);

 pinMode(G, OUTPUT);

}

 

void loop()

 analogWrite(R, 0);

 analogWrite(G, 0);

 

 // RED

 for (int i = 0; i < 256; i++)

 {

 analogWrite(R, i);

 delay(10); 

 }

 for (int i = 0; i < 256; i++)

 {

 analogWrite(R, 255-i);

 delay(10);

 }

 

 // YELLOW

 for (int i = 0; i < 256; i++)

 {

 analogWrite(G, i);

 delay(10);

 }

 for (int i = 0; i < 256; i++)

 {

 analogWrite(G, 255 - i);

 delay(10);

 }

 

 // RED + Green

 for (int i = 0; i < 256; i++)

 {

 analogWrite(R, i);

 analogWrite(G, i);

 delay(10);

 }

 

 for (int i = 0; i < 256; i++)

 {

 analogWrite(R, 255 - i);

 analogWrite(G, 255 - i);

 delay(10);

 } 

}

'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 Module DIP (KY-016) [D007]  (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 RD IoT RDIoT

댓글을 달아 주세요