Led ring with 8x WS2812 leds
| Pin | Signal | Description |
|---|---|---|
DI |
data | Data IN |
5V |
power | VCC 5V |
GND |
ground | GND |
DO |
data | Data OUT |
| From | To | Wire |
|---|---|---|
board:5V |
x1:5V |
red |
board:GND |
x1:GND |
black |
board:D6 |
x1:DI |
green |
This example was written and compile-checked for the arduino-uno. Codey Online adapts it to any other supported board for you.
// Canonical beginner example for a WS2812 LED Ring 8-bit
// This sketch lights the 8 LEDs one at a time in a simple chase pattern.
#include <Adafruit_NeoPixel.h>
#define PIN 6
#define NUMPIXELS 8
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
pixels.begin();
pixels.clear();
pixels.show();
}
void loop() {
// Chase a single red LED around the ring
for (int i = 0; i < NUMPIXELS; i++) {
pixels.clear();
pixels.setPixelColor(i, pixels.Color(255, 0, 0));
pixels.show();
delay(150);
}
// Turn all LEDs off briefly between cycles
pixels.clear();
pixels.show();
delay(300);
}
Describe what you want to build. Codey Online writes the code, draws the wiring diagram, compiles it and flashes your board straight from the browser.
Start for free