SmartMatrix 3
SmartMatrix Library v3 is a major update focused on supporting larger sized panels, and separating the Layer code from the Refresh code. A single version of the library can support all panel sizes in contrast to the separate releases for SmartMatrix_32x32 and SmartMatrix_16x32 before. The library is not backwards compatible with sketches created for SmartMatrix 2.x, but by following the MIGRATION.md document you can update your sketch by using find and replace in your text editor. You can have SmartMatrix3 installed in parallel with an existing SmartMatrix_32x32 or SmartMatrix_16x32 library without conflicts.
Big thanks to contributors @gregfriedland and @mrwastl for extensive help with this release.
New Features
Support for chaining panels to create larger matrix
- Combine several panels to make a long chain, or stack chained panels in a Z or C shape to make a larger display
- Largest supported sizes: 64x64-pixel or 32x128-pixel display using 4x 32x32 panels - 90Hz refresh rate with Teensy 3.1 at 96MHz. Even larger sizes are possible (e.g. 96x64 by sacrificing refresh rate and color depth).
- Examples are set to 32x32 by default, but can run at larger resolutions just by changing the
kMatrixWidth
andkMatrixHeight
constants in the sketch - Thanks @ncortot, @GaryBoone, and @mrwastl for pioneering this feature, and @mrwastl for testing and feedback during v3 development
Support for configuring library in sketch
- User-configuration options include: matrix size, layer color depth, refresh color depth, refresh buffer sizes, panel type, refresh and layer options.
- Thanks @gregfriedland for setting up the library for C++ templates.
New Layer class and Background, Scrolling, and Indexed Layers
- Include just the layers you need for your sketch, saving resources on the Teensy
- Add multiple transparent Layers e.g. multiple scrolling text layers (see MultipleTextLayers example)
- It's possible to create a custom Layer in your sketch (see the port of Fadecandy firmware to SmartMatrix for an example)
- Layer-specific methods were moved from the SmartMatrix class to the appropriate Layer class: e.g.
matrix.scrollText()
is nowscrollingLayer.start()
- The new Indexed Layer can be used to draw simple graphics (1 bit per pixel with transparency) to the screen while saving memory. The buffers for a 32x32-pixel Indexed layer are only 256 bytes, vs 6kB using the Background layer.
- Library examples were reworked to use the minimum number of layers and demonstrate the new Layer features
Improvements
Refresh code now recovers from refresh rate being set too high instead of crashing
- If the refresh code can't keep up with with the current refresh rate, it blanks the screen until it's caught up, and automatically lowers the refresh rate by 1Hz to move toward a sustainable refresh rate
- If the refresh code is just barely keeping up but not allowing the sketch to run, it lowers the refresh rate by 1Hz until the sketch has time to run.
Refresh rate calculation is now accurate; in SmartMatrix 2.x the calculation was off by around 10%. The default refresh rate used to be 135Hz which resulted in an actual refresh rate of 120Hz. The default is now an accurate 120Hz.
AnimatedGIFs example now has a more accurate GIF decoding framerate, and has initial support for larger display sizes (works at 64x64 and 32x128 with minor modifications).
Retired
Support for FastLED's SMART_MATRIX
controller (though SmartMatrix still works with FastLED!)
- The
SMART_MATRIX
controller was based on SmartMatrix 2.x, and is incompatible with SmartMatrix 3 - The FastLED_Controller example is removed, but FastLED_Functions with the same functionality still works
- See the MIGRATION.md document for how to modify sketches like FastLED_Controller for SmartMatrix 3
- Let us know if you want to see support for the FastLED
SMART_MATRIX
controller in the future
Note for Beta Testers
The changes since SmartMatrix 3 - Beta 1 are minimal:
- The variables used for dimensions and coordinates for the Layer class and for drawing are now uint16_t/int16_t to support a 256-pixel wide display. (Briefly tested with a 16x256 display - this may be officially supported in the future)
- You can now compile with Teensyduino option USB Type: "No USB"