#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel strip1(8, 35); // 棋盘的灯
Adafruit_NeoPixel strip2(8, 34);
void ws2812(void *parameter)
{
while (1)
{
strip1.setPixelColor(2, strip1.Color(255, 255, 255)); // 白色
strip1.show();
Serial.println("ws2812模块启动正常");
vTaskDelay(300);
}
}
void ws281(void *parameter)
{
while (1)
{
strip2.setPixelColor(3, strip2.Color(255, 255, 255)); // 白色
strip2.show();
Serial.println("ws281模块启动正常");
vTaskDelay(200);
}
}
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32-S2!");
xTaskCreate(ws2812, "ws2812", 8192, NULL, 1, NULL);
xTaskCreate(ws281, "ws281", 8192, NULL, 1, NULL);
}
void loop() {
}