Datasheet
The last argument is exactly the same as with the NeoPixel library, indicating the type of LED pixels being used. In the
majority of cases with the latest NeoPixel products, you can simply leave this argument off…the example code is just
being extra descriptive.
The point of this setup is that the rest of the sketch never needs to think about the layout of the matrix. Coordinate
(0,0) for drawing graphics will always be at the top-left, regardless of the actual position of the first NeoPixel.
Why not just use the rotation feature in Adafruit_GFX?
Adafruit_GFX only handles rotation. Though it would handle our example above, it doesn’t cover every permutation
of rotation
and mirroring
that may occur with certain matrix layouts, not to mention the zig-zag capability, or this next
bit…
Tiled Matrices
A
tiled
matrix is comprised of multiple smaller NeoPixel matrices. This is sometimes easier for assembly or for
distributing power. All of the sub-matrices need to be the same size, and must be ordered in a predictable manner. The
Adafruit_NeoMatrix() constructor then receives some additional arguments:
The first two arguments are the width and height, in pixels, of each tiled sub-matrix, not the entire display.
The next two arguments are the number of tiles, in the horizontal and vertical direction. The dimensions of the overall
display then will always be a multiple of the sub-matrix dimensions.
The fifth argument is the pin number, same as before and as with the NeoPixel library. The last argument also follows
prior behaviors, and in most cases can be left off.
The second-to-last argument though…this gets complicated…
With a single matrix, there was a starting corner, a major axis (rows or columns) and a line sequence (progressive or
zigzag). This is now doubled — similar information is needed both for the pixel order within the individual tiles, and the
overall arrangement of tiles in the display. As before, we add up a list of symbols to produce a single argument
describing the display format.
The NEO_MATRIX_* symbols work the same as in the prior single-matrix case, and now refer to the individual sub-
matrices within the overall display. All tiles must follow the same format. An additional set of symbols work similarly to
then describe the tile order.
The first tile must be located at one of the four corners. Add either NEO_TILE_TOP or NEO_TILE_BOTTOM and
NEO_TILE_LEFT or NEO_TILE_RIGHT to indicate the position of the first tile. This is independent of the position of the
first pixel within the tiles; they can be different corners.
Tiles can be arranged in horizontal rows or vertical columns. Again this is independent of the pixel order within the
tiles. Add either NEO_TILE_ROWS or NEO_TILE_COLUMNS.
Finally, rows or columns of tiles may be arranged in progressive or zigzag order; that is, every row or column proceeds
in the same order, or alternating rows/columns switch direction. Add either NEO_TILE_PROGRESSIVE or
NEO_TILE_ZIGZAG to indicate the order. BUT…if NEO_TILE_ZIGZAG order is selected, alternate lines of tiles must be
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(
matrixWidth, matrixHeight, tilesX, tilesY, pin, matrixType, ledType);
© Adafruit Industries https://learn.adafruit.com/adafruit-neopixel-uberguide Page 50 of 68