#include <Adafruit_NeoPixel.h>
#define LED_PIN 18
#define LED_COUNT 16
Adafruit_NeoPixel ledRing (LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32-S2!");
pinMode (LED_PIN, OUTPUT);
ledRing.begin(); // initialize WS2812B strip object (REQUIRED)
}
void loop() {
// put your main code here, to run repeatedly:
ledRing.clear();
for (int pixel = 0; pixel < LED_COUNT; pixel++) { // for each pixel
ledRing.setPixelColor(pixel, ledRing.Color(255, 0, 0)); // it only takes effect if pixels.show() is called
ledRing.show(); // update to the WS2812B Led Strip
delay(100); // 500ms pause between each pixel
}
delay(500); // this speeds up the simulation
}
Loading
esp32-s2-devkitm-1
esp32-s2-devkitm-1