一、产品参数:
尺寸:25*21mm
重量:4g
颜色:全彩 红绿蓝三基色
亮度:高亮
电压:5V
输入:数字电平
接口:Arduino 4P接口
平台:开发板、单片机
二、产品特性:
三基色原理显示多重颜色
通过PWM端口控制实现全彩显示
PWM接口可直接驱动
测试代码:
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);
}
수입신고 1USD |
구매/결제대행 1CNY |
TT송금 1CNY |
---|---|---|
6.81 CNY | 203.62 KRW | 0.149 USD |