I have a similar problem as Jeremy Williams regarding combining Teensy 3.1 with FastLED

I have a similar problem as Jeremy Williams regarding combining Teensy 3.1 with FastLED 3.1 and the PJRC audio library.

I have a Teensy 3.1 connected to a set of RGB shades, and when I use FastLED 3.1 and the audio library, I get LED corruption. About half the LEDs light up, the rest don’t. The audio library is performing a FFT on the Teensy analog audio input. Commenting out the audio library calls allows the LEDs to work.

When I roll back to FastLED 3.0, everything is OK. Are there any tricks/debug I can post to help getting both to coexist?

I only needed the wave, noise and palette functions newest versions so copied the files from 3.1 for just those and overwrote the installed 3.0 version, this allowed me to address all the lights and use audio without problems.

Add this lines before the #include <FastLED.h> in your sketch:

#define FASTLED_ALLOW_INTERRUPTS 0

(or edit fastled_config.h and uncomment out that line). In FastLED3.1 I added the ability for interrupts to run while writing out WS2812 led data. However, in order for that to work, the interrupts needed to take less than 10µs to run. If the audio library has interrupt handlers that are taking over 10µs to run then FastLED stops writing out the current frame (hence the “about half the leds light up”).

I put the statement at the top of the sketch, now I get no LEDs to toggle.

Re-pull FastLED3.1 and try again - I just put in a fix for what might be causing a problem for you.

OK, I pulled down the latest 3.1, and I still get no toggling.

Do you have a teensy 3.1 and ~60 WS2812 string around? Later I can upload a sketch for you to try.

I do, but probably won’t be able to do any kind of testing with hardware until tomorrow.

Here’s a modification of the Fire2012 example. The audio library was added along with an audio connection from the ADC input to an FFT analyzer.

My build setup is Arduino 1.0.6 along with Teensyduino 1.21-test2. Audio and FastLED libraries are pulled from the latest.

I just looked back at the code, and I realized that I was using an older version of my code that had some extra processing. Let me pare it down and get back to you with results.