Home

Awesome

Introduction

This is a collection of demos I gathered after writing my first Adadfruit::GFX demo ( GFX/MatrixGFXDemo ) and later GFX/fontzoom.

You'll find they are in 3 directories depending on which API they use (Adafruit::GFX, FastLED, or LEDMatrix)

Those demos work on multiple hardware backends thanks to https://github.com/marcmerlin/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos/blob/master/neomatrix_config.h
All those backends ultimately run on top of https://github.com/marcmerlin/Framebuffer_GFX , so you should have a look at it to understand the base layer/API everything is built on top of (and that library itself offers the Adafruit::GFX and FastLED APIs as explained in its README).

Below is a summary of how things work, but you'll find more details on this post: http://marc.merlins.org/perso/arduino/post_2020-03-16_Framebuffer_GFX_-Choosing-between-its-3-2D-APIs_-FastLED-XY_-NeoMatrix_-and-LEDMatrix_-and-detail-of-its-many-supported-hardware-backends.html

Hardware backends and glue drivers that can run this demo code

I used all the low level drivers on the left, wrote all the glue drivers in the middle, and FrameBuffer::GFX

Low Level Drv|Glue Driver for FrameBuffer::GFX
FastLED     - FastLED_NeoMatrix  -------------\     FastLED CRGB Array 
SmartMatrix - SmartMatrix_GFX -----------------\    24bit FB storage        API Support
ILI9341 \                                       \   CRGB methods like
SSD1331  |--- FastLED_SPITFT_GFX ----------------\  scale8/fadeToBlackBy   ,FastLED API
ST7735  /                                         |        |              / (XY 2D to 1D mapping)
                                                  |        |             /
ArduinoOnPc-FastLED-GFX-LEDMatrix arduino         - FrameBuffer::GFX------ Adafruit::NeoMatrix +
emulation for linux / Raspberry Pi:               |        |             \ Adafruit::GFX APIs
----------------------------------               /    Adafruit::GFX       \ 
rpi-rgb-led-matrix - FastLED_RPIRGBPanel_GFX ---/   LEDMatrix (optional)   `LEDMatrix API
ArduinoOnPC X11/linux - FastLED_TFTWrapper_GFX /
FastLED_SDL (linux)   -  FastLED_NeoMatrix   -/                        

neomatrix_config.h controls which hardware backend to run all demos on

For the demos to run, you need to edit https://github.com/marcmerlin/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos/blob/master/neomatrix_config.h and #define the correct backend for your display (SMARTMATRIX for instance)

Assuming you are running FastLED::NeoMatrix, you may want to try uncommmenting '#define M24BY24' and modifying the 2 code sections relevant to this define to put the correct data for your array.
Obviously you can look at M32BY8X3, M16BY16T4, and M64BY64 for ways to configure more complex matrices. If you haven't gotten your FastLED matrix to work at all, please do make those examples work first:

As of this writing, you can run on top of

If you are using some of the other backends, I'll assume that you can set the correct define in neomatrix_config For instance for //#define M24BY24 and replace with #define SMARTMATRIX if that's the backend you want.

History

This demo collection started after I wrote https://github.com/marcmerlin/FastLED_NeoMatrix which was designed to add GFX compatiblity for FastLED supported backends. In that process, I picked up some demos in the FastLED directory that I ported to NeoMatrix.

Some time after, I found that there was a different GFX compatible-ish library for Neopixel Matrixes, called LEDMatrix. I was able to make them compatible with FastLED::NeoMatrix which has better support for complex tiled matrices with random orientations (courtesy of the original Adafruit::NeoMatrix) and you can therefore use both APIs at the same time.

Later still, I had to use some RGB Panels for higher pixel density at the cost of lower brightness and more resource intensive driver (SmartMatrix). SmartMatrix however had a completely different (and better) API, but it was not compatible with all the demo code I already had, so I wrote https://github.com/marcmerlin/SmartMatrix_GFX to add a GFX/FastLED compatibility layer for SmartMatrix and allow all the demo code included here to run trivially on top of RGB Panels thanks to SmartMatrix.
It also adds LEDMatrix support on top of SmartMatrix if you use my very slightly modified fork:
https://github.com/marcmerlin/LEDMatrix
For instance, look at https://github.com/marcmerlin/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos/tree/master/LEDMatrix/Table_Mark_Estes

What you end up with are demos that run with multiple APIs (GFX, FastLED, and LEDMAtrix) on top of multiple hardware backends (listed above).

Demos examples

Enjoy,
Marc marc_soft@merlins.org