Datasheet
hard-wired to digital pin 6, but standalone matrices are free to use other pins.
The next argument is the interesting one. This indicates where the first pixel in the matrix is
positioned and the arrangement of rows or columns. The first pixel must be at one of the four
corners; which corner is indicated by adding either NEO_MATRIX_TOP or NEO_MATRIX_BOTTOM
to either NEO_MATRIX_LEFT or NEO_MATRIX_RIGHT. The row/column arrangement is indicated
by further adding either NEO_MATRIX_COLUMNS or NEO_MATRIX_ROWS to either
NEO_MATRIX_PROGRESSIVE or NEO_MATRIX_ZIGZAG. These values are all added to form a
single value as in the above code.
NEO_MATRIX_TOP + NEO_MATRIX_RIGHT + NEO_MATRIX_COLUMNS +
NEO_MATRIX_PROGRESSIVE
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.
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(
matrixWidth, matrixHeight, tilesX, tilesY, pin, matrixType, ledType);
© Adafruit Industries https://learn.adafruit.com/adafruit-neopixel-uberguide Page 32 of 39