A couple of years ago,

A couple of years ago, @marmil responded to someone who was looking for a marquee type animation for a project. You included this sketch:

Which works great. I’m trying to incorporate it into the Demo Reel format and I keep having problems. I basically made a function out of the lines that were part of the main loop of the original code. But I think the problem is caused by the Every_n_seconds commands being nested in the function which is being called over and over again. Heres the code as I have it now:

Thanks for the help!

@Tim_Lukasik I think it’s the fading tail part of the code that’s breaking it. Something with line 92 I’m guessing, because if you set fading tail to True then things works. I’ll try to look at it more later.

It’s ok to use EVERY_N in a function. For example, here’s a version of DemoReel with several functions that use EVERY_N.

@Tim_Lukasik Give this a try.
https://pastebin.com/kEBmddbk

Thanks @marmil , from your first post I did go back and look at my code and found one variable wrong but also realized that the problem was caused by the function writing the colored dots at a specific interval but the part which blacked them out ran every time so I was getting that flickering effect.

I copy/paste your code directly to a new sketch, adjusted the pin, led type and number of leds, uploaded it and nothing happens. I’m currently using a Trinket Pro 5v. I change over to my Circuit Playground, update pin, leds, etc and works beautifully.

Run a test sketch on the Trinket, works beautifully.

So there’s something in this new code that the trinket doesn’t like? I’ve never run into this before.

Isn’t there more then one version of the Trinket? Which one do you have?
*EDIT: @Tim_Lukasik Sorry I didn’t read carefully. See you’re using the Trinket Pro. What pin are you using for the leds Data?

@marmil I’m using Pin 5

@marmil I’m using Pin 5 on the Trinket Pro