v1.2版本改为通过xbox系列手柄进行遥控,并增加智能模式和手动模式
This commit is contained in:
1 parent
76603d3c31
commit
1a97bc32c3
1839 files changed
+478852
-3
No files matched your search
@@ -0,0 +1,66 @@
|
||||
#include <FastLED.h>
|
||||
|
||||
// FastLED配置
|
||||
#define NUM_LEDS 2
|
||||
#define DATA_PIN 21
|
||||
CRGB leds[NUM_LEDS];
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
Serial.println("FastLED RGB灯测试开始...");
|
||||
|
||||
// 初始化FastLED
|
||||
FastLED.addLeds<WS2812, DATA_PIN, GRB>(leds, NUM_LEDS);
|
||||
FastLED.setBrightness(50);
|
||||
|
||||
// 清除所有LED
|
||||
FastLED.clear();
|
||||
FastLED.show();
|
||||
delay(1000);
|
||||
|
||||
Serial.println("测试第一个灯(索引0)...");
|
||||
|
||||
// 测试第一个灯 - 红色
|
||||
leds[0] = CRGB::Red;
|
||||
FastLED.show();
|
||||
Serial.println("测试第一个灯(索引0) 红色");
|
||||
delay(2000);
|
||||
|
||||
// 测试第一个灯 - 绿色
|
||||
leds[0] = CRGB::Green;
|
||||
FastLED.show();
|
||||
Serial.println("测试第一个灯(索引0) 绿色");
|
||||
delay(2000);
|
||||
|
||||
// 测试第一个灯 - 蓝色
|
||||
leds[0] = CRGB::Blue;
|
||||
FastLED.show();
|
||||
Serial.println("测试第一个灯(索引0) 蓝色");
|
||||
delay(2000);
|
||||
|
||||
Serial.println("测试第二个灯(索引1)...");
|
||||
|
||||
// 测试第二个灯 - 红色
|
||||
leds[1] = CRGB::Red;
|
||||
FastLED.show();
|
||||
Serial.println("测试第二个灯(索引1) 红色");
|
||||
delay(2000);
|
||||
|
||||
// 测试第二个灯 - 绿色
|
||||
leds[1] = CRGB::Green;
|
||||
FastLED.show();
|
||||
Serial.println("测试第二个灯(索引1) 绿色");
|
||||
delay(2000);
|
||||
|
||||
// 测试第二个灯 - 蓝色
|
||||
leds[1] = CRGB::Blue;
|
||||
FastLED.show();
|
||||
Serial.println("测试第二个灯(索引1) 蓝色");
|
||||
delay(2000);
|
||||
|
||||
Serial.println("测试完成");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// 空循环
|
||||
}
|
||||
Reference in new issue
Block a user