I've been working on an application of FastLED with Teensy's Audio Library (I need

I’ve been working on an application of FastLED with Teensy’s Audio Library (I need FFT precision that an MSGEQ7 chip can’t provide), have any of you incorporated the two and managed to make it work on a sizeable scale (100+ LEDs)?

I’ve got the data running through a (MC)74HCT245(AN) IC into a 144-LED WS2811 strip and it seems to handle the FastLED examples just fine over the whole strip, but a simple test function I wrote that processes FFT data and drives a visual representation of it to the strip has trouble driving data to more than ~40-50 LEDs–it either simply leaves the LEDs following a certain point untouched or leaves a series of randomly-colored LEDS after the ones that are working.

Here’s a couple videos, circuit schematic and code to make it more clear what’s going on. Again, I don’t think it’s the circuitry because the FastLED example sketches work beautifully, but the code works on smaller scales.

How it’s supposed to look (smaller prototype of 8 LEDs): https://www.youtube.com/watch?v=-iYrEXVThAY&feature=youtu.be

How it looks on the 144-LED strip (note how it shuts off after one constant white LED at around the halfway point of the circuit): https://www.youtube.com/watch?v=NnDkDP81VVU&feature=youtu.be

Here’s another video with a smaller NUM_LEDS variable (NUM_LEDS is set to 10 here, note how there’s 10 normally-behaving LEDs followed by 10 constant white LEDs on the strip): https://www.youtube.com/watch?v=ivH5-kTpt5E&feature=youtu.be

Circuit: http://imgur.com/a/Vfuq9

Code: https://pastebin.com/fpegzHix

Thanks for your help!

It sounds like an interrupt problem…

Have you tried including the octows2811 library? As I understand it this caches the data and then writes it via the onboard SPI system freeing up the CPU and possible avoiding the interrupt problem. You don’t have to use the Octows2811 adapter but you will have to use FastLED in parallel output mode. Even for one strip. You will have to use the same pin(s) as on the board. Of it helps, you may even be able to wire up the LEDs as eight segments, then you write the data in 1/8th of the time :slight_smile: Not sure if it will clash with the audio board though. Might be worth checking the teensy forums.

You can also try the different FastLED interrupt modes, I’ve never used them but look them up.

Yeah make sure you don’t sample at the same time as doing your show(). It’s annoying because when using a large amount of LEDS, if your show() takes 20ms you kinda completely lose that 20ms of sound processing. But for a low amount of led like yours you shouldn’t see the loss.

hello fellow conn college camel! I did some work on this and got it working on my own setup. gist attached below. i didn’t, and have not yet had any crazy problems combing the teensy audio library fft/peak functions with fastled… i’ve also never had problems with interrupts and fastled? though frank and jeremy’s comments now have me researching that.

I’m a bit confused what exactly you were trying to see on your own strip, but I assume it is basically a vu meter the averaged color of the fft? i restructured it a bit to fit my style of fastled programming but it should run just fine if you include the global variables at the top and run “vu_color” in your main loop. comment below what you think/if this is sort of what you were going for. cheers.

https://gist.github.com/drewandre/83e864ae4aa617e504ffb9a03bb4b65f