-
-
Notifications
You must be signed in to change notification settings - Fork 257
Matrix Panels Support
NeoPixelBus uses a single index value to identify the pixel on the bus you want to access. While this is intuitive for strips and rings of pixels, its much less so for matrix or even tiled sets of matrix panels.
This library supports several layered approaches to accessing matrix panels in an intuitive manner. If you have a single matrix panel, then you want to use the NeoTopology class. If you have a tiled collections of matrix panels, then you will want to use either NeoTiles or NeoMosaic.
With all three of these classes, you will need to know how the pixels on the matrix panels are ordered, and this is where the Layout feature classes come in.
The layout objects are a collection of "feature" classes that define how items in a 2d grid are ordered. They include the following.
- RowMajorLayout
- RowMajor90Layout
- RowMajor180Layout
- RowMajor270Layout
- RowMajorAlternatingLayout
- RowMajorAlternating90Layout
- RowMajorAlternating180Layout
- RowMajorAlternating270Layout
- ColumnMajorLayout
- ColumnMajor90Layout
- ColumnMajor180Layout
- ColumnMajor270Layout
- ColumnMajorAlternatingLayout
- ColumnMajorAlternating90Layout
- ColumnMajorAlternating180Layout
- ColumnMajorAlternating270Layout
This object is constructed with a method from above to provide the mapping from the 2d coordinate system to index that the NeoPixelBus requires.
NeoTopology<RowMajorAlternatingLayout> topo(PanelWidth, PanelHeight);
This object is constructed with two methods from above to provide the mapping from the 2d coordinate system to index that the NeoPixelBus requires. One method defines an individual layout of a panel, the other defines how the panels are arranged. All panels within the collection are oriented in the same way.
NeoTiles <ColumnMajorAlternatingLayout, RowMajorAlternatingLayout> tiles(
PanelWidth,
PanelHeight,
TileWidth,
TileHeight);
This object is constructed with a method from above to provide the mapping from the 2d coordinate system to index that the NeoPixelBus requires. The method defines the layout of the physical panel but the orientation is ignored. The mosaic will automatically rotate the panels to provide the shortest interconnections between panels. The tiles in the mosaic are always laid out in RowMajorAlternating pattern.
NeoMosaic <ColumnMajorAlternatingLayout> mosaic(
PanelWidth,
PanelHeight,
TileWidth,
TileHeight);