I took some time today to test all the LEDMatrix demos from LEDText and LEDSprite on my weirdly sized weirdly wired 24x32 matrix.
Thanks to Jorgen-VikingGod’s work to add tiling support, once I figured out how to use it properly (it’s not super obvious), I was able to get the demos working.
LEDMatrix is a “competitor” to FastLED::NeoMatrix . Its font support is mostly superior, and it has proper sprite support while NeoMatrix/GFX has support for displaying bitmaps which you can easily create from animated gifs or jpegs.
I tried to write notes on how each is different/better than the other:
- Different API. NeoMatrix does offer a few things LEDMatrix does not, but LEDMatrix offers direct pointer to LED objects that you retrieve via X,Y coordinates, while NeoMatrix does not (it’s write only, but it can give you the index offset for an X,Y coordinate, so you can still use that to write/read from the LED array directly)
- LEDMatrix uses more memory I believe since it has its own objects that are separate from the led string initialized by FastLED, but it offers more functionality in return.
- NeoMatrix is Adafruit::GFX compatible
- Code written against NeoMatrix is compatible with any other display supported by Adafruit::GFX (specifically the cheaper and higher density scan matrices sold by adafruit and others).
- LEDMatrix is FastLED only and a different API, which includes extra things like mirroring
- NeoMatrix allows any orientation, including rotations (using an 8x32 matrix as 32x8). I think that ultimately LEDMatrix with Jorgen’s code, lets you use any orientation NeoMatrix can, but it’s definitely less obvious to setup if they are truly equivalent.
- NeoMatrix offers an XY function in the API to return an 1D array coordinate if dealing with existing code that addresses FastLED arrays directly.
- LEDMatrix does not seem actively maintained, but it’s good as is.
- LEDMatrix offers a better font library than Adafruit::GFX (better font rotation, animations, and colors)
- NeoMatrix offers bigger pre-existing font compatiblity
- NeoMatrix allows displaying jpegs easily converted to 565 bitmaps, at any position for easy scrolling
- LEDMatrix offers sprite support which is more memory efficient than moving around bitmaps in NeoMatrix, and includes code like edge detection and bouncing which I offer as example code in NeoMatrix. Actually NeoMatrix gives panning code (scrolling within a bitmap bigger than the display), which I think LEDMatrix does not offer.
- LEDMatrix offers sprite collision support which would just have to be done by code with NeoMatrix.
Is there a clear winner? I’d say no, and honestly for most uses both libraries will likely do the job. LEDMatrix has more interesting functionality that may not be useful to most, while offering an API that only works on FastLED while NeoMatrix is compatible with multiple other backends. Setting up your tiling matrices with LEDMatrix is pretty not obvious while it’s much more flexible and easy to use with NeoMatrix.
Also I believe you can actually run both at the same time anyway.