Marc's Public Blog - Arduino Hacking


All | Aquariums | Arduino | Btrfs | Cars | Cats | Clubbing | Dining | Diving | Electronics | Exercising | Flying | Hiking | Linux | Linuxha | Monuments | Museums | Public | Rc | Sciencemuseums | Snow | Solar | Trips



Table of Content for arduino:

More pages: 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



2018/04/23 FastLED::NeoMatrix library
π 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 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

See more images for FastLED::NeoMatrix library

More pages: 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