www.devicemart.co.kr/goods/view?no=1287089#goods_file
- Using 5050 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
- Operating voltage: 5V
- LED drive mode: common cathode
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(1);
}
for(val=0; val<255; val++)
{
analogWrite(11 val);
analogWrite(10 255-val);
analogWrite(9 128-val);
delay(1);
}
Serial.println(val DEC);
'project > 2020.12-02 (라즈베리파이) 눈으로운전하는휠체어' 카테고리의 다른 글
어제 오늘 (0) | 2021.01.27 |
---|---|
아두이노 초음파센서 4개, 부저 RGB LED 4개, LCD (0) | 2021.01.26 |
아두이노 초음파센서 4개, 부저 RGB LED 4개 (0) | 2021.01.22 |
오늘. 내일 (0) | 2021.01.21 |
dc모터 모터드라이브 사용해 2개 + 2개 동시 제어 (0) | 2021.01.21 |