I got some of the fantastic FastLED examples (copied and adapted from  Stefan Petrick

I got some of the fantastic FastLED examples (copied and adapted from @Stefan_Petrick and @Mark_Kriegsman ) working on an Adafruit Medium 32x32 RGB LED matrix panel. I used a Teensy v3.1 and the SmartMatrix shield and library from @Pixelmatix . More details to come, source available here: https://github.com/jasoncoon/SmartMatrix-FastLED-Examples
http://www.youtube.com/watch?v=3HAJHI5mqQ8

looks great!

Your source is nice and super organized! wish i had time to adapt some of this for my weekend show coming up

Thanks, but I can’t take credit for the organization. The code is just copied and adapted from others. Now that I have it working on the SmartMatrix and understand it, I plan to start on my own projects. :slight_smile:

Smooth. I dig it!

I will soon be adding support for SmartMatrix directly into FastLED (I have it running locally already) - it just becomes another controller.

FastLED.addLeds(leds, NUM_LEDS);

:slight_smile:

So, not only have I managed to get the above working (in a way that also still lets you use SmartMatrix’s drawing primitives and scrolling text) - and there’s even a mode for working with the original SmartMatrix library, no changes needed.

However, because I can’t leave well enough alone, i’ve also managed to bump the performance of SmartMatrix up a bit. I’ve gotten it from 40% CPU usage at 120Hz refresh down to 23% CPU usage at 120Hz refresh rates. (And from 68% at 240Hz down to 30%). I still have a little bit more performance work that I want to do, but if @Louis_Beaudoin takes my changes, it should help all SmartMatrix users, FastLED integrated or not.

That sounds fantastic, Daniel! If Louis doesn’t want them, I’ll take them! :slight_smile: Feel free to fork SmartMatrix on GitHub and push your changes. I’ll pull and test them. https://github.com/pixelmatix/SmartMatrix

I’ve just adapted Funky Clouds for the Technocolour Dreamcoat, and as @Randal_B says the source is really nicely laid out and it only took me a couple of minutes. Thanks @Stefan_Petrick ! On the physically bigger (~20 x 36) “display” of the coat, the movement is a little “bitty”, is there an easy way for me to speed it up? I’m running FastLED.show() in a loop every 1/60th of a second.

Also, I’ve got no idea how this oscillator stuff works conceptually. Is there any way I could adapt it to treat my matrix as “toroidal”, where if one of the clouds goes off the left of the array it appears on the right, and over the top, to the bottom and vice versa?

@Robert_Atkins , if you want it to run faster, make sure to remove any calls to delay, or replace them with calls to FastLED.delay, which will handle dithering at lower brightness and continually refresh the display. Are you running the “compendium” AutoRun mode, or just one pattern in particular? I can take a look and see if there are any optimizations to be made. What hardware are you running it on? My fork is meant specifically for the SmartMatrix board which uses a Teensy v3.1, which is much faster than Arduinos and uses DMA to drive the display. Each source file should have a link to Stefan’s original source, which is meant for use with just the FastLED library, and may work better on your hardware.

As for the oscillators, they just use sin8 to move some points around in sine waves. The patterns use them in different ways, like Dots1 and Dots2 just draw pixels at some of the points. The effects work by moving or dimming the colors in different ways. Instead of clearing the display each frame, the patterns place light, which then gets moved and/or smeared around by the effects. You can change where the patterns place the light, and you can change the way the effects move the light around. You could modify the HorizontalStream method, for example, to wrap color from the right side of the display to the left. I stared at the code for quite a while before I figured out how it worked well enough to adapt it. :slight_smile:

I realised as I was drifting off to sleep last night that there were delays implied in the timer “tact” properties; my code works by only calling the main draw method every 60ms, so I probably want to shorten some of those delays. I’ll take a look at the original code again tonight, that might provide more hints.

And now I’ve just realised what else is making Funky Clouds look odd on my setup:

  1. It’s additive between frames (I blank the whole leds[] array after every frame in my setup)

  2. My matrix has “holes” (well, I’ve got to put my neck and arms somewhere!) and the funky clouds operations reference previously written parts of the matrix, for which I’m returning a dummy value in some circumstances. This gets me a shimmering chunk of whitish always-on pixels on my right shoulder. I think I can fix this though…

When I have the SmartMatrix here I will optimize the effects for the bigger size and there are some bug fixes on the to do list, too.

One more remark: the spiral code as it is right now defines a center point and a radius. That means the area it affects has allways an odd sidelength. It was basically a dirty hack that turned out to work so well that it survived until today. A work arround for now would be to only draw the emitter line in the by the spiral affected area to avoid the dead pixels at the right and down column/row. A spiral code for a square with an even sidelength is noted on the to do list… as many many other things…

Yeah, I fixed the ‘dead’ pixels in the spiral effect, but not sure if I pushed that change to the SmartMatrix-FastLED-Examples repo.

Excellent work on Aurora – and thanks for rebuilding the hex – although I’d just gotten it to build and make the same lzw size update. I just got the Sparkfun remote and hooked it up and I discovered I had the RTC sitting around so I just added that and it worked on the first try!

@Scott_Bennett Thanks! Glad to hear everything is working for you.