Skip to main content

MicroPython Library

The WS2812Grid module drives this board from MicroPython. It builds on MicroPython's own neopixel module and adds an (x, y) interface on top. Create a WS2812Grid object with the machine.Pin wired to DIN, call begin() to start with every pixel off, colour LEDs with setPixel() and send them to the grid with show().

(0, 0) is the top-left LED, where the data enters. x grows to the right and y downward, so you never deal with the serpentine order the LEDs are wired in. For several chained grids, pass the panel's full width and height (multiples of 8) and the same coordinates run across all of them.

Brightness works differently from the Arduino library: setBrightness() scales each colour as you set it, so call it before setPixel() or fill().

Not installed yet? Follow Quick Start before using the functionality pages.

Functionality​

Each page starts with one verified module example and explains every function the example uses to get that result.