Op werkdagen vóór 14:00 uur besteld = dezelfde dag verzonden en in 98% van de gevallen de volgende dag in huis. Gratis retourneren 30 dagen bedenktijd 1 jaar garantie
← Tillbaka till översikten

Kopplingsschema och kodexempel

Så här kopplar du 8x8 RGB 64 LED-matris 5V WS2812b till en Arduino UNO eller ESP32, med ett exempel­sketch som du kan ladda upp direkt.

8x8 WS2812B RGB LED Matrix Demo

This project demonstrates an 8x8 WS2812B addressable RGB LED matrix connected directly to an Arduino Uno. The sketch initializes the 64 LEDs and displays a rotating color pattern across the matrix at a safe brightness level. Connect the 5V, GND, and DI pins as shown to test your matrix in minutes.

Kopplingsschema: 8x8 RGB 64 LED-matris 5V WS2812b på en Arduino UNO
Kopplingsschema · Klicka för att förstora
Kopplingstabell: 8x8 RGB 64 LED-matris 5V WS2812b på en Arduino UNO
Kopplingstabell · Klicka för att förstora
8x8_WS2812B_RGB_LED_Matrix_Demo.ino · kompilerad och testad
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : 8x8 WS2812B RGB LED Matrix Demo
 *  Board     : Arduino UNO (arduino:avr:uno)
 *  Parts     : 8x8 RGB 64 LED Matrix 5V WS2812b
 *  Libraries : Adafruit NeoPixel 1.15.5
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

#include <Adafruit_NeoPixel.h>

#define LED_PIN   6
#define LED_COUNT 64

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

// Converts (x, y) coordinates to pixel index (serpentine layout)
uint16_t getPixelIndex(uint8_t x, uint8_t y) {
  if (y % 2 == 0) {
    return y * 8 + x;
  } else {
    return y * 8 + (7 - x);
  }
}

void setup() {
  Serial.begin(115200);
  matrix.begin();
  matrix.setBrightness(30); // Keep brightness low when powered from Arduino 5V
  matrix.show();            // Turn off all pixels
  Serial.println(F("WS2812B 8x8 LED Matrix ready!"));
}

void loop() {
  static uint16_t hueOffset = 0;

  for (uint8_t y = 0; y < 8; y++) {
    for (uint8_t x = 0; x < 8; x++) {
      uint16_t pixelHue = hueOffset + ((x + y) * 65536L / 16);
      uint32_t color = matrix.gamma32(matrix.ColorHSV(pixelHue));
      matrix.setPixelColor(getPixelIndex(x, y), color);
    }
  }

  matrix.show();
  hueOffset += 500;
  delay(20);
}

Nödvändiga bibliotek: Adafruit NeoPixel 1.15.5

Wiring diagram and example code generated by Codey.online — https://www.codey.online

WS2812B 8x8 RGB LED Matrix Rainbow Demo

This project drives an 8x8 WS2812B RGB LED matrix using an ESP32. It cycles colorful rainbow patterns across all 64 individual addressable LEDs. The brightness is set low to ensure safe operation directly via USB power.

Kopplingsschema: 8x8 RGB 64 LED-matris 5V WS2812b på en ESP32 DevKit V1
Kopplingsschema · Klicka för att förstora
Kopplingstabell: 8x8 RGB 64 LED-matris 5V WS2812b på en ESP32 DevKit V1
Kopplingstabell · Klicka för att förstora
WS2812B_8x8_RGB_LED_Matrix_Rainbow_Demo.ino · kompilerad och testad
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : WS2812B 8x8 RGB LED Matrix Rainbow Demo
 *  Board     : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
 *  Parts     : 8x8 RGB 64 LED Matrix 5V WS2812b
 *  Libraries : Adafruit NeoPixel 1.15.5
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

#include <Adafruit_NeoPixel.h>

#define LED_PIN    4
#define LED_COUNT  64
#define BRIGHTNESS 30

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

void setup() {
  Serial.begin(115200);
  matrix.begin();
  matrix.setBrightness(BRIGHTNESS);
  matrix.show();
  Serial.println("WS2812B 8x8 Matrix Initialized");
}

void loop() {
  // Rainbow cycle across the matrix
  for (long firstPixelHue = 0; firstPixelHue < 5 * 65536; firstPixelHue += 256) {
    for (int i = 0; i < matrix.numPixels(); i++) {
      int pixelHue = firstPixelHue + (i * 65536L / matrix.numPixels());
      matrix.setPixelColor(i, matrix.gamma32(matrix.ColorHSV(pixelHue)));
    }
    matrix.show();
    delay(15);
  }
}

Nödvändiga bibliotek: Adafruit NeoPixel 1.15.5

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Tidigare visade

5V 4-fas stegmotor 28BYJ-48

5V 4-fas stegmotor 28BYJ-48

€ 2,95
500Ma Mini Solar Lipo Lithium-laddningsmodul CN3065

500Ma Mini Solar Lipo Lithium-laddningsmodul CN3065

€ 2,25
Isopropanol Alcohol 99.9% 20ml med pensel

Isopropanol Alcohol 99.9% 20ml med pensel

€ 7,70
Visa
Strömförsörjning 12V 2A adapter 5.5mm x 2.5mm jack

Strömförsörjning 12V 2A adapter 5.5mm x 2.5mm jack

€ 6,99
USB-A till USB-C-kabel 30 cm kort svart

USB-A till USB-C-kabel 30 cm kort svart

€ 2,15
Justerbar Step-down-modul 4~38V 5A 96% Hög effektivitet XL4015

Justerbar Step-down-modul 4~38V 5A 96% Hög effektivitet XL4015

€ 2,60
USB-A till Micro-USB kabel 1 meter (För ESP8266, ESP32 och Wemos)

USB-A till Micro-USB kabel 1 meter (För ESP8266, ESP32 och Wemos)

€ 2,00
Tryckknapp | moment - puls | 14x20 runt hål 12mm | Blå

Tryckknapp | moment - puls | 14x20 runt hål 12mm | Blå

€ 1,00
Rak PCB Header Connector - 5 pins, Rastermått 2,54 XH2.54mm

Rak PCB Header Connector - 5 pins, Rastermått 2,54 XH2.54mm

€ 0,35
1602 LCD grå/svart med bakgrundsbelysning

1602 LCD grå/svart med bakgrundsbelysning

€ 3,85