FastLED support is only for APA102, correct?

I have a bunch of code I wrote for FastLED::NeoMatrix (which offers the Adafruit::GFX API) which I’m going to port to SmartMatrix.
I really don’t want to change the code to use the SmartMatrix API since I just want it to keep working if I swap hardware backends on it (afterall that was the point of using Adafruit::GFX).
Adafruit::GFX of course does support LED Panels, I even wrote demo code for it: RGB-matrix-Panel/examples/PanelGFXDemo_16x32 at master · adafruit/RGB-matrix-Panel · GitHub
but this is not compatible with SmartMatrix.

Am I correct that basically my best bet is to write a SmartMatrix::NeoMatrix glue library that will take GFX code and send it to SmartMatrix? At the same time, I’ll probably offer basic FastLED compat shims too.

Does that sound like the right way to do it, or was it done already, or am I thinking about doing it wrong?

Thanks, Marc

1 Like

Hi Marc, I’d start with the FastLED_Functions example, which shows how to get a pointer to the buffer structure inside SmartMatrix Library, fill it efficiently, and swap buffers to refresh the contents of the buffer on the panels:

https://github.com/pixelmatix/SmartMatrix/blob/master/examples/FastLED_Functions/FastLED_Functions.ino#L99

For a simpler but less efficient way of loading the buffers, see the code in the AnimatedGIFs example callback functions:

https://github.com/pixelmatix/SmartMatrix/blob/master/examples/FastLED_Functions/FastLED_Functions.ino#L99

  • Louis

Thanks, I will have a look when I work on this over my vacation.