Codey OnlineBiblioteka komponentów Arduino i ESP32 › 8x8 RGB 64 LED Matrix 5V WS2812b
8x8 RGB 64 LED Matrix 5V WS2812b
Wyświetlacze

8x8 RGB 64 LED Matrix 5V WS2812b

Matryca LED RGB 8x8 (64) z adresowalnymi diodami WS2812b do indywidualnie sterowanych pikseli. Zwykle jest sterowana przez mikrokontroler za pomocą jednego sygnału danych i wspólnego zasilania 5V ze wspólną masą GND. Często łączona szeregowo i używana do prostych grafik, animacji oraz wyświetlania stanu.

Szerokość: 66.3 mm

Pinout — 8x8 RGB 64 LED Matrix 5V WS2812b

Pin Sygnał Opis
5V power 5V power input rail for the WS2812B LED matrix.
GND ground Common ground reference for power and data signals.
DI data Serial data input from the microcontroller to drive the first LED.
DO data Serial data output from the last LED for chaining another matrix.
GND ground Ground output/reference for a chained LED matrix.
5V power 5V rail output for powering or chaining LED matrices.

Przykładowy schemat połączeń — 8x8 RGB 64 LED Matrix 5V WS2812b

Z Do Przewód
board:5V x1:5V red
board:GND x1:GND black
board:D6 x1:DI green

Przykładowy kod Arduino — 8x8 RGB 64 LED Matrix 5V WS2812b

Ten przykład został napisany i sprawdzony kompilacją dla arduino-uno. Codey Online dostosuje go do każdej innej obsługiwanej płytki.

#include <Adafruit_NeoPixel.h>

#define LED_PIN 6
#define LED_COUNT 64

Adafruit_NeoPixel matrix(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);

uint32_t colorFromXY(uint8_t x, uint8_t y) {
  // Simple rainbow-style gradient across the 8x8 matrix.
  uint8_t r = x * 32;
  uint8_t g = y * 32;
  uint8_t b = 255 - (x + y) * 16;
  return matrix.Color(r, g, b);
}

uint16_t xyToIndex(uint8_t x, uint8_t y) {
  // Common serpentine wiring for many 8x8 WS2812 matrices.
  // If your specific module uses a different layout, adjust this mapping.
  if (y % 2 == 0) {
    return y * 8 + x;
  } else {
    return y * 8 + (7 - x);
  }
}

void showDemoPattern() {
  matrix.clear();

  for (uint8_t y = 0; y < 8; y++) {
    for (uint8_t x = 0; x < 8; x++) {
      matrix.setPixelColor(xyToIndex(x, y), colorFromXY(x, y));
    }
  }

  matrix.show();
}

void setup() {
  Serial.begin(115200);
  matrix.begin();
  matrix.setBrightness(40);
  matrix.show(); // Initialize all pixels to off

  Serial.println("8x8 WS2812B matrix demo starting...");
}

void loop() {
  showDemoPattern();
  Serial.println("Showing color gradient on the 8x8 matrix.");
  delay(1000);

  matrix.clear();
  matrix.show();
  Serial.println("Cleared matrix.");
  delay(500);
}

Podobne komponenty

1.28" Round TFT LCD 240x240 (GC9A01, SPI)

1.28" Round TFT LCD 240x240 (GC9A01, SPI)

1602 LCD DISPLAY

1602 LCD DISPLAY

1602 LCD I2C DISPLAY

1602 LCD I2C DISPLAY

LCD Display TFT 1.3inch ST7789

LCD Display TFT 1.3inch ST7789

Zbuduj swój projekt Arduino lub ESP32 z pomocą AI

Opisz, co chcesz zbudować. Codey Online napisze kod, narysuje schemat połączeń, skompiluje projekt i wgra go na płytkę bezpośrednio z przeglądarki.

Zacznij za darmo