Hi, I’m Louis, and I made the SmartMatrix Library and SmartMatrix Shield for Teensy to make it easy to display high quality graphics on low cost multiplexed RGB matrix displays. My friend @JasonCoon made the Aurora application that plays Animated GIFs, Patterns, and Audio Patterns using the SmartMatrix Shield, and together we build the SmartMatrix Display. I’m porting the SmartMatrix Library to Photon and will be designing a shield.
I’m working on a port of the full SmartMatrix Library to Photon, including support for low cost multiplexed matrix panels, but it’s a big challenge because of the DMA differences between the Freescale processor used in the Teensy and the STM32 processor used in the Photon. In the meantime, I’m adding drivers for more types of LEDs to the SmartMatrix Library, starting with support for APA102 addressable LEDs (Adafruit calls these DotStars). The core features of the Photon APA102 driver are working now.
The SmartMatrix Library has these core features that I want to maintain for all displays:
- Support for multiple layers with transparency, including scrolling text that scrolls automatically in the background
- High color depth and automatic color correction (gamma correction)
- Background display refresh using DMA
- Brightness control without sacrificing color depth
I chose APA102s over more common WS2812s (Adafruit calls these Neopixels) because of the 2-wire interface and Global Brightness Control feature. The 2-wire interface allows the LEDs to be refreshed using the SPI peripheral, with DMA to automate the transfer in the background, freeing up the CPU. The Global Brightness Control (GBC) feature allows you to lower the brightness of individual LEDs while still retaining 24-bit color, and as I found through experimentation, can be used to get >24-bit color out of the LEDs by setting the GBC value for each LED dynamically based on a 16-bit per channel RGB value. Normally to get lower brightness without sacrificing color depth or > 24-bit color out of addressable LEDs you need to use dithering which takes up more CPU and can result in visible flickering at lower brightnesses.
Here’s a demo video showing the SmartMatrix Library in action on the Photon with a APA102 matrix, running two of the example sketches that are included in the library. The video is intended to demonstrate how the Dynamic GBC feature in SmartMatrix can provide similar results to FastLED’s temporal dithering at low (25%) brightness, with much less CPU usage, and can provide better results than temporal dithering at very low brightnesses (~3% brightness) where you see slight flicker with dithering and significant color banding without dithering. Note that the SmartMatrix Library is intended to work alongside FastLED and isn’t a replacement for it. I shared this dynamic GBC idea with @dgarcia a couple months ago, and hope it makes it into a future 16-bit version of FastLED.
The Library port is still in the early stages, but you can try it yourself. The sketches used to make the demo video above are included as examples.
Don’t let the “SmartMatrix” name scare you away if you want to drive a strip of APA102 LEDs and not a matrix, I intend to make the library usable for both 1-dimensional strips as well as matrices.