Does anyone have any experience with using the FastLED.show() method in an interrupt routine...is

Does anyone have any experience with using the FastLED.show() method in an interrupt routine…is this generally problematic and not recommended? I have a two Serial devices (GPS and Bluetooth) and a two I2C (Pressure sensor and IMU) devices connected to my Teensy 3.2 running at 96mHz, and I’m concerned that I will find communication problems and blocking issues if I proceed down this avenue. It would be good to get a preliminary sense of whether this is an issue.

Thanks in advance for any insights or experiences with this approach.

I can’t say if using show() in an ISR is/would be problematic or not, but my first thought would be don’t run show() there. Use the ISR to set a flag True that will cause show() to run after you’re back to your main loop.

Ok…thanks for the advice. I’m trying to have the LED’s run different sequences, colors, patterns as a way to signal the user about different states for the device …ie logging, erasing, etc, but I keep running into this general problem :

If I use interrupts to drive the LED’s then the sequences run outside my main loop and run smoothly regardless of what is happening in other functions which is great! If I poll for updates to flags, and/or use things like millis() to update the LED’s in my main loop, then I end up with sporadic LED sequencing as other functions do their thing before getting back to check for updates to the flags or whatever.

From where I stand in my admittedly limited programming knowledge, it seems that I have to either fill all of my non-LED related functions with lines of code that check for updates, or I have to find a way to use interrupts.

Are there other ways to go about this that I am not seeing?

I know this is a more general question that might not be suited to this forum, but FastLED seems like the right library to be using to solve my problem, so I thought I’d throw it out there.

Thanks again for any help with this.

Checking for updates multiple places should be fine if your checks are fast. Can you put all the checks in a subroutine and then call that whenever you need to know the states of things before continuing?

When you say use millis to update the LEDs can you share what you are doing? Share your code to pastebin or gist and maybe we can see where something is slowing something down.

What type and how many pixels in your setup?