RGB LED 모듈 -5V
(RGB LED Module -5V, Common Cathode)
개요
- 본 제품은 RGB LED 모듈입니다.
- RGB LED가 장착되어 있으며, 모듈에는 저항이 장착되어 있어 마이크로컨트롤러와 연결시 별도의 저항이 필요가 없습니다.
- PWM을 이용하여 R/G/B의 밝기를 제어할 수 있으며, 색상을 변화 시킬 수 있습니다.
특징
- the use of plug-in full-color LED
- 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
- the working voltage: 5V
- LED drive mode: common cathode driver
문서
- Arduino pin 11 --> Pin R module
- Arduino pin 10 --> Pin G module
- Arduino pin 9 --> Pin B module
- Arduino pin GND --> Pin - module
- You don't need any resistors, these are already included on the module.
//KY016 3-color LED module int redpin = 11; // select the pin for the red LED int bluepin = 10; // select the pin for the blue LED int greenpin = 9 ;// select the pin for the green LED int val; void setup () { pinMode (redpin, OUTPUT); pinMode (bluepin, OUTPUT); pinMode (greenpin, OUTPUT); Serial.begin (9600); } void loop () { for (val = 255; val> 0; val --) { analogWrite (11, val); analogWrite (10, 255-val); analogWrite (9, 128-val); delay (10); Serial.println (val, DEC); } for (val = 0; val <255; val ++) { analogWrite (11, val); analogWrite (10, 255-val); analogWrite (9, 128-val); delay (10); Serial.println (val, DEC); } }