Datasheet

The extra ifdef/define/endif lines are only needed if you’re using an Arduino Due. Otherwise they
can be left out.
Layouts
Adafruit_NeoMatrix uses exactly the same coordinate system, color functions and graphics
commands as the Adafruit_GFX library. If you’re new to the latter, a separate tutorial explains its
use (http://adafru.it/aPe). There are also example sketches included with the Adafruit_NeoMatrix
library.
We’ll just focus on the constructor here — how to declare a two-dimensional display made from
NeoPixels. Powering the beast is another matter, covered on the prior page.
The library handles both single matrices — all NeoPixels in a single uniform grid — and tiled
matrices — multiple grids combined into a larger display:
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.
© Adafruit Industries https://learn.adafruit.com/adafruit-neopixel-uberguide Page 29 of 39