Port of Adafruit's Adafruit_NeoMatrix library for the Arduino to CircuitPython.
See the Adafruit NeoPixel Überguide for everything you need to know about NeoPixel grids.
- Features:
- Single matrix: 8x8, 16x16, 8x32, 32x8 NeoPixels
- Tiled matrices: multiple single matrices
- Horizontal strips (row major)
- 8w * 8h, 16w * 16h , 8w * 32h
- zigzag and progressive rows
- Vertical strips (column major)
- 8w * 8h, 16w * 16h, 32w * 8h
- zigzag and progressive columns
- Position of first Pixel
- Bottom, Top, Left, Right
- Assumption: only identical matrices are used
- tiles of size 8 * 8, or 16 * 16, or 8 * 32, or 32 * 8
- Tiles are laid out in a regular style
- N * tiles in X direction, either Left --> Right, or reversed
- M * tiles in Y direction, either Top --> Down, or reversed
- tiles are wired either in progressive or zigzag mode
- Position of first Tile
- Bottom, Top, Left, Right
- Determine size and led arrangement of a single NeoPixel matrix.
- Determine number and tile arrangement of your NeoPixel matrices.
- Use these values to compute a
matrixTypevariable and several size values. - Create a normal CircuitPython
neopixel.NeoPixelobject. - Use this
NeoPixelobject, thematrixTypevariable, and size values to create aneomatrix.NeoMatrixobject. - Finally, use the APIs of the
NeoMatrixobject to draw colorful animations using X and Y coordinates.
A NeoMatrix object is made from a NeoPixel strip, a FrameBuffer object,
and from a PixelGrid object. That's why several APIs can be used to change the color of NeoPixels.
This drawing API is based on the adafruit_pixel_framebuf library by Melissa LeBlanc-Williams.
However, it is extended from one matrix to an array of matrix tiles.
This drawing API is based on the adafruit_led_animation.grid library by Kattni Rembor.
However, it is extended from one matrix to an array of matrix tiles.
The examples directory has several demos that are showing how the
neomatrix.py library and the helper modules matrix<##>.py can be used.
Python files with an 8 in the name are intended for 8x8 or 8x32 NeoPixel matrices. Files with a 16 in the name are meant for 16x16 NeoMatrices and files with a 32 in the name should be used for tiled 32x32 matrices.
examples/
├── berlin # "Berlin-Uhr"
├── bounce # bouncing lines and random walks
├── rainbow # spiraling rainbows
├── life # Tim C's Game of Life animation
├── snake # Tim C's snake animation
├── fire # Mark Kriegsman's Fire2012 simulation
├── water # Waterfall (Fire2012 with a blue palette)
└── snoise # Simplex Noise demo using Tod Kurt's library