|

楼主 |
发表于 2022-7-12 11:35:35
|
显示全部楼层
【花雕体验】19 合宙ESP32_C3点亮WS2812B硬屏
实验程序一:64位绿色上漂灯
- /*
- 【花雕体验】19 合宙ESP32_C3点亮WS2812B硬屏
- 实验程序一:64位绿色上漂灯
- */
- #include <Adafruit_NeoPixel.h>
- #define PIN 9
- #define MAX_LED 64
- int val = 0;
- Adafruit_NeoPixel strip = Adafruit_NeoPixel( MAX_LED, PIN, NEO_RGB + NEO_KHZ800 );
- void setup() {
- strip.setBrightness(150);
- strip.begin();
- strip.show();
- }
- void loop() {
- uint8_t i, a = 0;
- uint32_t color = strip.Color(160, 10, 10);
- while (a < 64)
- {
- for (i = 0; i < 64; i++)
- {
- if (i == a) strip.setPixelColor(i, color);
- else strip.setPixelColor(i, 0);
- }
- strip.show();
- delay(6);
- a++;
- }
- }
复制代码
|
|