Datasheet
Let’s begin with the declaration for a single matrix, because it’s simpler to explain. We’ll be demonstrating the NeoPixel
Shield for Arduino in this case — an 8x5 matrix of NeoPixels. When looking at this shield with the text in a readable
orientation, the first pixel, #0, is at the top left. Each successive pixel is right one position — pixel 1 is directly to the
right of pixel 0, and so forth. At the end of each row, the next pixel is at the left side of the next row. This isn’t
something we decide in code…it’s how the NeoPixels are hard-wired in the circuit board comprising the shield.
We refer to this layout as
row major
and
progressive.
Row major
means the pixels are arranged in horizontal lines (the
opposite, in vertical lines, is
column major
).
Progressive
means each row proceeds in the same direction. Some
matrices will reverse direction on each row, as it can be easier to wire that way. We call that a
zigzag
layout.
However…for this example, we want to use the shield in the “tall” direction, so the Arduino is standing up on the desk
with the USB cable at the top. When we turn the board this way, the matrix layout changes…
© Adafruit Industries https://learn.adafruit.com/adafruit-neopixel-uberguide Page 48 of 68