[an error occurred while processing this directive] >>> Back to post index <<<

2018/04/23 FastLED::NeoMatrix library: how to do Matrices with FastLED and Adafruit::GFX
π 2018-04-23 01:01 in Arduino
I've been a fan of Neopixels and Adafruit's Neomatrix library since last year. Why is Neomatrix special? It allows you to create Neopixel matrix displays and treat them like a panel display on which you can apply Adafruit::GFX primitives.

The problem is that https://github.com/adafruit/Adafruit_NeoMatrix only supports the https://github.com/adafruit/Adafruit_Neopixel backend which in turn only supports neopixels, and only in a serialized fashion. Serialized means that if you have 1024 pixels (32x32 matrix), it takes about 35 to 40ms to send a single frame, which means you can only update at a 25fps rate, which is not that good.

https://github.com/FastLED/FastLED fixes this by offering support for a lot of different kinds of LEDs, but also for offering parallel output on multiple MCUs, allowing you to get up to 16x faster updates by segmenting the strip to update sequentially. It also offers much nicer primitives like automatic fading, and the ability to have multiple independent strips of different lengths that can display different patterns.

Neomatrix is aweseome since it offers access to the GFX library primitives (circles, lines, rectangles, and fonts), but since it didn't work with a FastLED backend, I ported it to FastLED.

You can get the code here: https://github.com/marcmerlin/FastLED_NeoMatrix
You can also see my NeoMatrix Shirt on this page


Hello world
Hello world

Thanks to Adafruit::GFX, it's easy to display fonts and bitmaps
Thanks to Adafruit::GFX, it's easy to display fonts and bitmaps

32x32 is slightly better to display bitmaps
32x32 is slightly better to display bitmaps


This will be the display on my shirt
This will be the display on my shirt

GFX allows drawing lines, circles and all
GFX allows drawing lines, circles and all

Fonts can be of any size
Fonts can be of any size

[an error occurred while processing this directive] >>> Back to post index <<<

Contact Email