This is just a quick heads-up to let you know that I’m working on a MAX7219 library for NodeMCU. In October last year I first experimented with MAX7219 8×8 matrix displays. Ever since then I wanted to create a library that would support daisy-chained displays and a few text animations. I finally kicked myself in the butt and started tinkering.
The library will allow you to
- define number of displays you connected
- set characters as bytes
- set text and a font table (8 bytes per char)
- scroll the text left and right
- oscillate text
- rotate and invert individual characters
That last feature is quite important for daisy-chained displays. Depending on the module and how they’re chained characters may have to be transformed to appear as you expect them to.
Text displayed on 4-in-1 modules must be rotated left by 90°. If you daisy-chain the standalone modules manually no rotating is necessary but you may want to invert the characters to turn your chain up-side down.


The library is on GitHub at https://github.com/marcelstoer/nodemcu-max7219 and I invite you give it a try. I appreciate if you create an issue on GitHub should you run into problems. General remarks are very welcome here, however.
I you need a beta tester, I willingly offer me. 🙂
Thank you, noted.
You may follow the progress right on GitHub: https://github.com/marcelstoer/nodemcu-max7219
Wow, I have been looking for solutions to control LED matrices and here I stumble upon this. I will definitely keep an eye on it. Thanks.
Cool library. Excellent work. Thank you!
I just added tmr.wdclr() in the loop in commit() function, because I test it using 8 modules and the watchdog did reset the device.
And the last one – may be the library will stop working if the compilation is “float”…
Thanks for this feedback, much appreciated. Feel free to open individual issue on GitHub for your findings. It’s true, I have neither tested with more than 4 display modules nor with a float firmware.
As for watch dod feeding and performance, there are low-level functions in the NodeMCU SPI module which would probably greatly improve things. I don’t really understand SPI though and haven’t dared to touch them yet. I’m actually surprised I got this far with this library despite my lack of SPI/electronics know-how.
The float issue was just fixed: https://github.com/marcelstoer/nodemcu-max7219/pull/5.
Any thoughts about using more than 4 modules — or in general, what might have to change? I’m interested in using this module with my own setup, which uses 16 MAX7219 devices, but it doesn’t seem to work past 4. I wouldn’t mind poking around the code a bit but I’m still getting a feel for the NodeMCU.
Sorry, somehow missed that comment 🙁 As said previously there’s spi.transaction() which can possibly be used to avoid the slow loops in https://github.com/marcelstoer/nodemcu-max7219/blob/master/max7219.lua#L33
Since the MAX7219 can drive 7-segment displays as well: Are there plans to extend the library?
Then I guess you’ll like that it’s all there already, someone forked and extended it: https://github.com/marcelstoer/nodemcu-max7219
Due to lack of hardware I never verified myself, though.
Thanks, Marcel, for pointing… I should have scrolled down a bit in README.md first.
As I had suspected from a first quick look into the code, it’s not possible to show “…” (one has to write7segment(“,,,”) instead (dots are collapsed into a single one and “kerned” to the preceding character). Not a big problem 😉
What I’m missing (Arduino’s LedControl library has them) is graphics primitives: Something to set and clear (and perhaps toggle) individual dots. (This might require a backing store to “know” about the current state, in particular if mixed with string operations.) I’ll look into it when I’m back from the vacation…
How do I use this library? I have added libraries from zips’ before but not sure with it being lua.
Not sure I understand, there’s sample code at https://github.com/marcelstoer/nodemcu-max7219.