Skip to content

SolderedElectronics/Soldered-WS2812B-Grid-Arduino-Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Soldered WS2812B Grid Arduino Library

Make docs and publish to GitHub Pages Arduino Library Manager Compatibility

Soldered WS2812B Grid
WS2812B 8x8 LED Grid

Arduino library for controlling one or more Soldered WS2812B 8×8 LED grids using a simple (x, y) coordinate system. Multiple panels can be chained horizontally and/or vertically and addressed as a single continuous grid. Part of the Qwiic ecosystem.


Features

  • (x, y) coordinate API, no manual index calculation needed
  • Supports single 8×8 panels and multi-panel arrangements
  • Multi-panel chaining: columns of panels are chained first (top→bottom), then the next horizontal column
  • Per-pixel RGB or packed-color control
  • Full-grid fill, brightness control, and pixel readback
  • Based on the Soldered WS2812 / Adafruit NeoPixel driver

Wiring & Panel Layout

Each panel is an 8×8 WS2812B grid with internal serpentine wiring:

  • Even rows (0, 2, 4 …) run left → right
  • Odd rows (1, 3, 5 …) run right → left

When chaining multiple panels, they are connected column-first:

Single panel (8×8):          Two panels wide (16×8):
┌────────┐                   ┌────────┬────────┐
│ Panel 0│                   │Panel 0 │Panel 1 │
│ LEDs   │                   │LEDs    │LEDs    │
│ 0–63   │                   │0–63    │64–127  │
└────────┘                   └────────┴────────┘

Two panels tall (8×16):      2×2 arrangement (16×16):
┌────────┐                   ┌────────┬────────┐
│ Panel 0│                   │Panel 0 │Panel 2 │
│ LEDs   │                   │LEDs    │LEDs    │
│ 0–63   │                   │0–63    │128–191 │
├────────┤                   ├────────┼────────┤
│ Panel 1│                   │Panel 1 │Panel 3 │
│ LEDs   │                   │LEDs    │LEDs    │
│ 64–127 │                   │64–127  │192–255 │
└────────┘                   └────────┴────────┘

Connect the data-out pin of the last panel in each column to the data-in of the first panel in the next column.


API Reference

Method Description
WS2812Grid(pin, width=8, height=8) Construct grid driver. width and height must be multiples of 8.
begin() Initialize driver, blank display, call once in setup().
setPixel(x, y, r, g, b) Set one LED by RGB components.
setPixel(x, y, color) Set one LED by packed uint32_t color.
getPixel(x, y) Read back stored color of one LED.
fill(r, g, b) Fill entire grid with one RGB color.
fill(color) Fill entire grid with packed color.
show() Push all changes to hardware (inherited).
clear() Blank all LEDs (inherited).
setBrightness(b) Global brightness 0–255 (inherited).
Color(r, g, b) Pack RGB into uint32_t — static helper (inherited).
xyToIndex(x, y) Coordinate → linear LED index, 0xFFFF if out of range.

(0, 0) is the top-left corner. X increases to the right, Y increases downward.


Repository Contents

  • /src — source files for the library (.h & .cpp)
  • /src/libs — bundled Soldered WS2812 and Adafruit NeoPixel drivers
  • /examples — ready-to-run Arduino sketches
  • keywords.txt — syntax highlighting for the Arduino IDE
  • library.properties — Arduino Library Manager metadata

Documentation

Access Arduino library documentation here.

Board Compatibility

The library is compatible with board & microcontroller families shown in green below:

Compile Sketches

About Soldered

soldered-logo

At Soldered, we design and manufacture a wide selection of electronic products to help you turn your ideas into acts and bring you one step closer to your final project. Our products are intended for makers and crafted in-house by our experienced team in Osijek, Croatia. We believe that sharing is a crucial element for improvement and innovation, and we work hard to stay connected with all our makers regardless of their skill or experience level. Therefore, all our products are open-source. Finally, we always have your back. If you face any problem concerning either your shopping experience or your electronics project, our team will help you deal with it, offering efficient customer service and cost-free technical support anytime. Some of those might be useful for you:

Open-source License

Soldered invests vast amounts of time into hardware & software for these products, which are all open-source. Please support future development by buying one of our products.

Check license details in the LICENSE file. Long story short, use these open-source files for any purpose you want to, as long as you apply the same open-source licence to it and disclose the original source. No warranty — all designs in this repository are distributed in the hope that they will be useful, but without any warranty. They are provided "AS IS", therefore without warranty of any kind, either expressed or implied. The entire quality and performance of what you do with the contents of this repository are your responsibility. In no event, Soldered (TAVU) will be liable for your damages, losses, including any general, special, incidental or consequential damage arising out of the use or inability to use the contents of this repository.

Have fun!

And thank you from your fellow makers at Soldered Electronics.

About

An arduino library for utilizing the Soldered Smart LED WS2812B Grid

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors