So, I was finally able to write my first version of FastLED_Neomatrix https://github.com/marcmerlin/FastLED_NeoMatrix You

So, I was finally able to write my first version of FastLED_Neomatrix https://github.com/marcmerlin/FastLED_NeoMatrix

You don’t know Adafruit_Neomatrix and you’re using matrices of pixels? Then, you probably should. See: http://marc.merlins.org/perso/arduino/post_2017-04-24_Adafruit-GFX-on-NeoMatrix-and-RGB-Matrix-Panel-Demo.html

Neomatrix, outside of doing panel tiling and coordinate calculations for you, gives you full access to Adafruit::GFX, i.e. drawing and font primitives. Of course, you can also draw bitmaps, but if this is all you do, FastLED might be good enough for you.

Anyway, here is my preliminary code: https://github.com/marcmerlin/FastLED_NeoMatrix
issues so far:

  1. it only supports neopixels, although adding other LED types is trivial. Sadly, the unfortunate use of templates in FastLED is making things very hard, unless I’m missing something, see:
    https://github.com/marcmerlin/FastLED_NeoMatrix/blob/master/FastLED_NeoMatrix.cpp#L88
    Right now, I’m considering how to better handle this. I’ll probably be forced to create the FastLED string outside of my object due to all the pain and restrictions that come from the use of templates in FastLED :frowning:

  2. there is a bug I need to track down where the code doesn’t display anything on teensy v3 unless I load another piece of code that uses FastLED or Adafruit_Neopixel and displays something on my matrix. Then, I upload my other code with FastLED_NeoMatrix, and it works until my next power cycle of the teensy v3, weird…
    and even more weird, it works 100% fine in ESP8266, so it may be a problem with the FastLED driver for teensy?

missing/deleted image from Google+

missing/deleted image from Google+

Do you have a ‘keywords.txt’ file for your library?

@Mike_Thornbury to be honest, I’ve never used/needed one, nor do I really know how to use it :slight_smile:
That said, my lib is a fork of adafruit’s lib, but modified to work with FastLED instead. It comes with library.properties: https://github.com/marcmerlin/FastLED_NeoMatrix/blob/master/library.properties

But basically if you’d like help to try out the library, let me know. You just need to install it in arduino/libraries and then you can look at https://github.com/marcmerlin/FastLED_NeoMatrix/blob/master/examples/MatrixGFXDemo/MatrixGFXDemo.ino for the example code that generates the video you saw in the comments above

@Marc_MERLIN They’re easy - you just list the keywords you can use with the library.

Like this, for Jon Christensen’s Timezone lib:

TimeChangeRule KEYWORD1
Timezone KEYWORD1
toLocal KEYWORD2
toUTC KEYWORD2
utcIsDST KEYWORD2
locIsDST KEYWORD2
readRules KEYWORD2
writeRules KEYWORD2

It makes it easy when you are unfamiliar with the lib and are looking for functions to iterate.

And thanks, I’ve downloaded it, but haven’t yet written anything with it in.

@Mike_Thornbury Ah, got it. To be honest,

  1. none of the adafruit libs use this AFAIK, and they’ve written a lot of libs
  2. given that I’m effectively re-offering what they wrote, but for the FastLED backend, that’d be a fair amount of words to add, GFX is a big lib :slight_smile:
  3. for now, I’d recommend you just try to get https://github.com/marcmerlin/FastLED_NeoMatrix/blob/master/examples/MatrixGFXDemo/MatrixGFXDemo.ino working on your hardware. If/when it works, you can look at what the code does, I actually wrote a fair amount of demos that use most of the functionality of the @Adafruit_Industries ’ s GFX lib, but with the more powerful FastLED backend.

If you don’t use Neopixels however, please let me know and I can show you how to use a different LED backend driver (sadly, the approach I wanted to use in the library really collided with the limitations introduced by fastled’s use of C++ templates :frowning: )

@Marc_MERLIN (1) yep, they do: https://github.com/adafruit/Adafruit_NeoPixel/blob/master/keywords.txt

@Mike_Thornbury that’s adafruit neopixel, I forked adafruit neomatrix :slight_smile: (neomatrix was 100% replaced by FastLED, that was the point of my work)

Sorry - cross purposes. You said adafruit don’t use keywords files - they do, I guess it just depends who wrote the git

@Mike_Thornbury yeah, you seem to be correct on that one.

@Marc_MERLIN Marc, not meant as a criticism at all. Thanks for your work on this library - really helpful :slight_smile: