Fadecandy - pixelmatix/SmartMatrix GitHub Wiki
Fadecandy
"Fadecandy is a tool for creating interactive light art using addressable LED lighting" designed by Micah Elizabeth Scott (scanlime), and was made to drive WS2811 "Neopixel" addressable LEDs over USB with higher color depth and smoother interpolation than they normally have. Our fork of Fadecandy adds support for driving HUB75 panels by using SmartMatrix Library on the Teensy 3 and Teensy 4.
The Teensy 3 support is older, more limited, and there's not much reason to maintain it now that there's Teensy 4 support, so for new projects I recommend using the Teensy 4.
SmartMatrix with Teensy 3.1/3.2
The Fadecandy fork has a new device class added to the server to add support for driving a Teensy 3.1/3.2 driving a SmartMatrix display. A new "smartmatrix" device is created, see /examples/config/smartmatrix*.json
for examples of using the server. The "smartmatrix" device is nearly identical to the "fadecandy" device, with unique USB IDs, and an additional USB message "TYPE_EXPAND" that sends the high bits of packet index to allow expanding beyond 32 packets per frame (32x21 pixels gives a limit of 672 pixels). The server modifications don't affect the "fadecandy" device, so this server should be able to drive "fadecandy" devices as before, and you should be able to combine "smartmatrix" and "fadecandy" devices (untested as of yet).
SmartMatrix running on a Teensy 3.1/3.2 can support driving more pixels per device than Fadecandy (the Teensy 3.1/3.2 has more memory and CPU speed than the Teensy 3.0-based Fadecandy, and uses a different type of LED panel). The server is configured to send 2048 pixels - enough for a 32x64 pixel panel - per frame. You may get better performance by changing NUM_PIXELS in /server/src/smartmatrixdevice.h
to the number of pixels in your panel.
The SmartMatrix_Fadecandy firmware for Teensy 3.1/3.2 is stored in a separate repo: https://github.com/pixelmatix/SmartMatrix_fadecandy
Note: the "smartmatrix" name was chosen when SmartMatrix Library only ran on the Teensy 3.1, and a more specific name is probably needed now that there's a Teensy 4 SmartMatrix device now. The device may get renamed to "teensy3" something similar soon, but I'll add in backwards compatibility if possible.
With the new Teensy 4.0 being the same price as a Teensy 3.2, and being much more powerful, there's not much reason to use the Teensy 3.2 anymore for Fadecandy with SmartMatrix, so this device is unlikely to be improved in the future.
There are several Processing examples updated for running on SmartMatrix: /examples/processing/smartmatrix*
You should use ledGrid() with these parameters for driving a SmartMatrix device:
stripLength = SmartMatrix panel width
numStrips = SmartMatrix panel height
zigzag = false
SmartMatrix with Teensy 4.0/4.1
The Fadecandy fork also has a new device class added to the server to add support for driving a Teensy 4.0/4.1 driving a SmartMatrix display. This "teensy4" device uses a different protocol than the Teensy 3.1/3.2 SmartMatrix device. See /examples/config/teensy4*.json
for examples of using the server. The "teensy4" device is significantly different from the "fadecandy" device as it uses simple serial communication over USB CDC. The Teensy 4 uses USB High Speed with a lot more bandwidth than the Teensy 3's USB Full Speed, so having an optimized protocol isn't as important.
The Teensy 4 has enough CPU, RAM, and USB bandwidth to transfer over 10,000 pixels at 60FPS, and refresh a HUB75 panel with 36-bit color, at 240Hz refresh rate.
While this device is fairly functional, there are still some unfinished features:
- The "color" settings are ignored, the device just does simple color (gamma) correction using on on-device lookup table
- You can't reorder the color channels, it's fixed as RGB order (alternate RGB order is probably of limited use for this device)
- CMAKE hasn't been fully updated to compile all the latest changes (please help with this if you need CMAKE)
- The server has only been compiled on MacOS so far. Please help with this if you can improve the Makefile, or post to let us know it's working or broken at SmartMatrix Community
- There's some other minor "TODO"s listed in teensy4device.cpp
There are several Processing examples updated for running on SmartMatrix: /examples/processing/smartmatrix*
You should use ledGrid() with these parameters for driving a SmartMatrix device:
stripLength = SmartMatrix panel width
numStrips = SmartMatrix panel height
zigzag = false
This has been tested on one MacOS 10.15.7 machine, and likely has issues compiling on other machines and operating systems. The major change made to add "teensy4" device support is the addition of libusbp, which has platform specific specific sections in the Makefile I somewhat blindly copied over. Please get in contact through GitHub Issues or at SmartMatrix Community if you have trouble or can help.