
专业版
RGB LED 模块
58
0
0
0
简介
RGB LED 模块
简介:RGB LED 模块复刻成本:¥2
开源协议
:GPL 3.0
创建时间:2025-03-10 22:57:17更新时间:2025-03-17 03:33:07
描述
RGB LED 模块
Arduino 测试代码
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);
// 红色
delay(1000);
setColor(0, 255, 0);
// 绿色
delay(1000);
setColor(0, 0, 255);
// 蓝色
delay(1000);
setColor(255, 255, 0);
// 黄色
delay(1000);
setColor(80, 0, 80);
// 紫色
delay(1000);
setColor(0, 255, 255);
// 浅绿色
delay(1000);
}
void
setColor(
int
red,
int
green,
int
blue)
{
analogWrite(redPin, 255-red);
analogWrite(greenPin, 255-green);
analogWrite(bluePin, 255-blue);
}
设计图

BOM


添加到专辑
0
0
分享
侵权投诉
评论