Codey OnlineArduino- & ESP32-Komponentenbibliothek › WS2812 LED Ring 8-bit
WS2812 LED Ring 8-bit
Ausgabe

WS2812 LED Ring 8-bit

LED-Ring mit 8x WS2812-LEDs

Breite: 33.2 mm

Pinbelegung — WS2812 LED Ring 8-bit

Pin Signal Beschreibung
DI data Data IN
5V power VCC 5V
GND ground GND
DO data Data OUT

Beispielschaltplan — WS2812 LED Ring 8-bit

Von Nach Kabel
board:5V x1:5V red
board:GND x1:GND black
board:D6 x1:DI green

Arduino-Beispielcode — WS2812 LED Ring 8-bit

Dieses Beispiel wurde für das arduino-uno geschrieben und kompiliergeprüft. Codey Online passt es für jedes andere unterstützte Board an.

// 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);
}

Ähnliche Komponenten

3W amplifier MAX98357A I2S DAC

3W amplifier MAX98357A I2S DAC

Active Buzzer Module

Active Buzzer Module

⚙️

LED

LED Matrix Module MAX7219

LED Matrix Module MAX7219

Bau dein Arduino- oder ESP32-Projekt mit AI

Beschreib einfach, was du bauen willst. Codey Online schreibt den Code, zeichnet den Schaltplan, kompiliert alles und flasht dein Board direkt aus dem Browser.

Kostenlos starten