Marc's Public Blog - Arduino Hacking


All | Aquariums | Arduino | Btrfs | Cars | Cats | Clubbing | Computers | Dining | Diving | Electronics | Exercising | Festivals | Flying | Halloween | Hiking | Linux | Linuxha | Monuments | Museums | Outings | Public | Rc | Sciencemuseums | Solar | Tfsf | Trips



>>> 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


More pages: August 2023 June 2023 May 2023 March 2022 January 2022 December 2020 March 2020 January 2020 May 2019 April 2019 March 2019 January 2019 July 2018 May 2018 April 2018 January 2018 June 2017 April 2017 January 2017 February 2016 January 2015 September 2013 January 2012 December 2011 May 2011 January 2011

>>> Back to post index <<<

Contact Email