User Manual
DotStarMatrix Library
The Adafruit_DotStarMatrix library builds upon Adafruit_DotStar to create two-dimensional graphic displays using
DotStar LEDs. You can then easily draw shapes, text and animation without having to calculate every X/Y pixel position.
Small DotStar matrices are available in the shop. Larger displays can be formed using sections of DotStar strip, as
shown above.
In addition to the Adafruit_DotStar library (which was already downloaded and installed in a prior step), DotStarMatrix
requires two additional libraries:
1. Adafruit_DotStarMatrix (https://adafru.it/iZA)
2. Adafruit_GFX (https://adafru.it/cBB)
If you’ve previously used any Adafruit LCD or OLED displays, you might already have the latter library installed.
Installation for both is similar to Adafruit_DotStar before: using the Arduino Library Manager (in recent versions of the
Arduino IDE) is recommended. Otherwise, if you manually download: unzip, make sure the folder name matches the
.cpp and .h files within, then move to your Arduino libraries folder and restart the IDE.
Arduino sketches need to include all three headers just to use this library:
Layouts
Adafruit_DotStarMatrix 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 (https://adafru.it/aPe). There are also
example sketches included with the Adafruit_DotStarMatrix library.
We’ll just focus on the
constructor
here — how to declare a two-dimensional display made from DotStars. Powering the
beast is another matter, covered on a prior page.
The library handles both
single
matrices — all DotStars in a single uniform grid — and
tiled
matrices — multiple grids
combined into a larger display:
#include <Adafruit_GFX.h>
#include <Adafruit_DotStarMatrix.h>
#include <Adafruit_DotStar.h>
© Adafruit Industries https://learn.adafruit.com/adafruit-dotstar-leds Page 37 of 48