Datasheet

Now the first pixel is at the top right. Pixels increment top-to-bottom — it’s now column major. The order of the
columns is still progressive though.
We declare the matrix thusly:
The first two arguments — 5 and 8 — are the width and height of the matrix, in pixels. The third argument — 6 — is the
pin number to which the NeoPixels are connected. On the shield this is 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
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(5, 8, 6,
NEO_MATRIX_TOP + NEO_MATRIX_RIGHT +
NEO_MATRIX_COLUMNS + NEO_MATRIX_PROGRESSIVE,
NEO_GRB + NEO_KHZ800);
© Adafruit Industries https://learn.adafruit.com/adafruit-neopixel-uberguide Page 49 of 68