Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.

WS2812B strip and the RGB LED on ESP32-C6-DevKitC-1

Drive a WS2812B strip from GPIO10 of an ESP32-C6-DevKitC-1 on its own 5 V supply, and mirror its colour on the board’s RGB LED on GPIO8.

Arduino C++Verified — core esp32 3.3.12, Adafruit NeoPixel 1.15.5, 3 Nov 2026Compile-only

Community draft — report a mistake

The ESP32-C6-DevKitC-1 comes with one addressable LED on board, which makes it a good place to learn NeoPixel code. This guide adds a real strip on GPIO10 with its own 5 V adapter and a common ground.

The sketch runs a rainbow along the strip and shows the first pixel’s colour, dimmed, on the board’s own LED.

Wiring

ESP32-C6-DevKitC-1Only the pins used are shown · 3.3 V logic5 V 2 A adapterWS2812B addressable RGB LED strip (NeoPixel)330 Ω+5VGND10 · 10GNDDIN5VGNDDOUT (not connected)
Also needed: 330 Ω resistor, 1000 µF / 10 V capacitor, 5 V 2 A adapter.
Every connection
ESP32-C6-DevKitC-1WS2812B addressable RGB LED strip (NeoPixel)WireNotes
10DINgreenVia 330 Ω
5 V 2 A adapter · +5V5Vred1000 µF capacitor across 5V/GND at the strip.
5 V 2 A adapter · GNDGNDblack
GNDGNDblackCommon ground with the DevKitC.

5 V (about 60 mA per LED at full white) part, 3.3 V board. The strip expects a data HIGH of about 3.5 V at 5 V supply. From ESP32 or Pico the 3.3 V signal often works with short wires, but to be safe drive DIN through a 74AHCT125 (or 74HCT125) powered from 5 V.

Board quirks

  • The DevKitC-1 already has a WS2812 on GPIO8. RGB_BUILTIN points at it, and rgbLedWrite() drives it without any library.
  • The C6 has only two RMT transmit channels. The strip and the on-board LED use one each, so a third LED output would need another method.
  • Don’t put the strip on GPIO8 itself (strapping pin, already used by the LED) or on GPIO12/13 (USB).

Code

ws2812b-esp32c6.inoArduino C++Open in PlaygroundOpen in PlaygroundFlash
// WS2812B strip on an ESP32-C6-DevKitC-1, plus the board's own RGB LED on GPIO8.
// DIN → GPIO10 through 330 Ω. Strip 5V/GND → its own 5 V supply; supply GND → board GND.
#include <Adafruit_NeoPixel.h>

constexpr uint8_t STRIP_PIN = 10;
constexpr uint16_t COUNT = 30;
Adafruit_NeoPixel strip(COUNT, STRIP_PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  Serial.begin(115200);
  strip.begin();
  strip.setBrightness(60);
  strip.show();
  Serial.printf("WS2812B: %u LEDs on GPIO10, on-board LED on GPIO8\n", COUNT);
}

void loop() {
  static uint16_t hue = 0;
  for (uint16_t i = 0; i < COUNT; i++) {
    strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(hue + i * 65536UL / COUNT)));
  }
  strip.show();
  // The on-board LED follows the colour of the first pixel, dimmed.
  uint32_t c = strip.gamma32(strip.ColorHSV(hue));
  rgbLedWrite(RGB_BUILTIN, (c >> 16 & 0xFF) / 8, (c >> 8 & 0xFF) / 8, (c & 0xFF) / 8);
  hue += 256;
  delay(20);
}

Library: Adafruit NeoPixel (Adafruit) — compiled with Adafruit NeoPixel 1.15.5.

Expected serial output

Serial Monitor · 115200Output
WS2812B: 30 LEDs on GPIO10, on-board LED on GPIO8

Common errors

Strip dark, on-board LED works

Missing common GND, or data into DOUT instead of DIN.

Colours flicker on the first LED

3.3 V data is marginal for 5 V LEDs. Shorten the data wire or add a 74AHCT125 buffer.

↑↓ to move · Enter to open