6x10 RGB MATRIX
Last updated
Last updated
Introducing the "6x10 RGB-MATRIX for XIAO" - a dazzling addition to the XIAO product series by Seeed Studio. Now, with the 6x10 RGB-MATRIX, you have the power to illuminate your projects with a spectrum of colors. Comprising 60 meticulously arranged WS2812 LEDs, this matrix isn't just about aesthetics; it's a tool to bring your creative visions to life. Whether you're crafting an interactive art piece, designing a dynamic notification system, or simply wish to add a splash of color to your creations, this matrix is your canvas. Tailored for seamless integration with the XIAO main controller, its adaptability is further highlighted with the inclusion of VCC, GND, and DIN solder pads, ensuring flexibility across a multitude of scenarios.
60 WS2812 LEDs: Arranged in a 6x10 grid, these LEDs are perfect for creating vibrant displays.
Compact Design: Each LED is just 1mm x 1mm, offering a high-density display without taking up much space.
Versatile Connection: While it's designed for the XIAO main controller, we've also included VCC, GND, and DIN solder pads for broader applications.
RGB Capabilities: Each LED can display a wide range of colors, giving you the freedom to create dynamic and colorful displays.
LED Type: WS2812
Number of LEDs: 60
Arrangement: 6 rows x 10 columns
LED Size: 1mm x 1mm
Connection Port for XIAO: D0
Additional Pads: VCC, GND, DIN, DOUT
Interactive Displays: Use the LED matrix for dynamic visual feedback in your projects.
Notifications: Create colorful notifications or alerts for your devices.
Art Installations: Incorporate the LED matrix into art pieces for a modern touch.
Wearable Tech: Integrate into clothing or accessories for a futuristic look.
Gaming: Enhance gaming experiences with vibrant visual effects.
General Lighting: Use for ambient lighting or mood-setting in various environments.
Welcome to the quick start guide for the 6x10 RGB-MATRIX for XIAO. This guide aims to help you set up and get started with your new LED matrix expansion board in conjunction with the XIAO RP2040 main controller.
Upon receiving your product, some soldering will be required. We've provided two pin headers with the package. You'll need to solder these headers onto the expansion board.
Once the soldering is complete, you can proceed to connect the expansion board to the XIAO RP2040 main controller.
This tutorial will use XIAO RP2040 as the master, if you are using XIAO RP2040 for the first time, please read its Getting Started Wiki.
Meanwhile, all the example programs provided in this tutorial will work on other XIAOs as well, and you can also configure the Arduino development environment in advance according to the XIAO you are using.
Before we get started developing a sketch, let's look at the available functions of the library.
Adafruit_NeoPixel(uint16_t n, int16_t pin = 6, neoPixelType type = NEO_GRB + NEO_KHZ800);
—— NeoPixel constructor when length, pin and pixel type are known at compile-time.
Input parameters:
n
: Number of NeoPixels in strand.
p
: Arduino pin number which will drive the NeoPixel data in.
t
: Pixel type -- add together NEO_* constants defined in Adafruit_NeoPixel.h, for example NEO_GRB+NEO_KHZ800
for NeoPixels expecting an 800 KHz (vs 400 KHz) data stream with color bytes expressed in green, red, blue order per pixel.
Return value: Adafruit_NeoPixel object. Call the begin()
function before use.
void begin(void)
—— Configure NeoPixel pin for output.
void show(void)
—— Transmit pixel data in RAM to NeoPixels.
void setPin(int16_t p)
—— Set/change the NeoPixel output pin number. Previous pin, if any, is set to INPUT and the new pin is set to OUTPUT.
Input parameters:
p
: Arduino pin number (-1 = no pin).
void setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b, uint8_t w)
—— Set a pixel's color using separate red, green, blue and white components (for RGBW NeoPixels only).
Input parameters:
n
: Pixel index, starting from 0.
r
: Red brightness, 0 = minimum (off), 255 = maximum.
g
: Green brightness, 0 = minimum (off), 255 = maximum.
b
: Blue brightness, 0 = minimum (off), 255 = maximum.
w
(Optional): White brightness, 0 = minimum (off), 255 = maximum, ignored if using RGB pixels.
void setPixelColor(uint16_t n, uint32_t c)
—— Set a pixel's color using a 32-bit 'packed' RGB or RGBW value.
Input parameters:
n
: Pixel index, starting from 0.
c
: 32-bit color value. Most significant byte is white (for RGBW pixels) or ignored (for RGB pixels), next is red, then green, and least significant byte is blue.
void fill(uint32_t c = 0, uint16_t first = 0, uint16_t count = 0)
—— Fill all or part of the NeoPixel strip with a color.
Input parameters:
c
: 32-bit color value. Most significant byte is white (for RGBW pixels) or ignored (for RGB pixels), next is red, then green, and least significant byte is blue. If all arguments are unspecified, this will be 0 (off).
first
: Index of first pixel to fill, starting from 0. Must be in-bounds, no clipping is performed. 0 if unspecified.
count
: Number of pixels to fill, as a positive value. Passing 0 or leaving unspecified will fill to end of strip.
void setBrightness(uint8_t b)
—— Adjust output brightness. Does not immediately affect what's currently displayed on the LEDs. The next call to show()
will refresh the LEDs at this level.
Input parameters:
b
: Brightness setting, 0=minimum (off), 255=brightest.
void clear(void)
—— Fill the whole NeoPixel strip with 0 / black / off.
void updateLength(uint16_t n)
—— Change the length of a previously-declared Adafruit_NeoPixel strip object. Old data is deallocated and new data is cleared. Pin number and pixel format are unchanged.
Input parameters:
n
: New length of strip, in pixels.
void updateType(neoPixelType t)
—— Change the pixel format of a previously-declared Adafruit_NeoPixel strip object. If format changes from one of the RGB variants to an RGBW variant (or RGBW to RGB), the old data will be deallocated and new data is cleared. Otherwise, the old data will remain in RAM and is not reordered to the new format, so it's advisable to follow up with clear()
.
Input parameters:
t
: Pixel type -- add together NEO_* constants defined in Adafruit_NeoPixel.h, for example NEO_GRB+NEO_KHZ800
for NeoPixels expecting an 800 KHz (vs 400 KHz) data stream with color bytes expressed in green, red, blue order per pixel.
static uint32_t Color(uint8_t r, uint8_t g, uint8_t b)
—— Convert separate red, green and blue values into a single "packed" 32-bit RGB color.
Input parameters:
r
: Red brightness, 0 to 255.
g
: Green brightness, 0 to 255.
b
: Blue brightness, 0 to 255.
Return: 32-bit packed RGB value, which can then be assigned to a variable for later use or passed to the setPixelColor()
function. Packed RGB format is predictable, regardless of LED strand color order.
Method One
The Adafruit NeoPixel Library will be used in this tutorial, you can search for it in the Arduino's library manager and download and install it.
Since you have downloaded the zip Library, open your Arduino IDE, click on Sketch > Include Library > Add .ZIP Library. Choose the zip file you just downloaded,and if the library install correct, you will see Library added to your libraries in the notice window. Which means the library is installed successfully.
The following sample program is used to achieve the effect of running lights, where the lamp beads will be lit sequentially one by one. This program is compatible with all XIAO.
Upload the program and if all goes well, you can see the light beads light up one by one.