Hey guys ! i need some help to fit a loop for my new project.
I’m trying to control 2 different animations for 2 different led strips (neopixel 60 led per mt) at the same time and with a button cycler loop, but when i run the first case (1 strip with Fade, and the other with Fire2012) the first one runs perfectly with the defined delay, but the second (the original fastled fire2012 dosen’t have any delay) runs very slow.
So my question is, there’s any trick that i can code to have 2 different delays for 2 separate strips in 1 switch-case ?
When I think of delays, I think delay(x), which is OK for a single animation without any inputs. For anything else (such as simultaneous displays) it can be disastrous. Mark did an example called twoanimations last year. It’s at:
The thing is, don’t use blocking delays or you’re hooped.
Edit: Oh, and one easy way to do it is to use the FastLED EVERY_N_MILLISECONDS(x) function call for each of the displays.
thx for the fast response Andrew ! i’m looking at one of your examples to get it 
https://github.com/atuline/FastLED-Demos/blob/master/fastled_tips_snippets.ino
can you show me how to set the timing in this loop with the EVERY_N_MILLISECOND function please ?
void flow() {
static uint8_t hue = 0;
for(int i = 0; i < NUM_LEDS2; i++) {
CircleStrip[i] = CRGB CIRCLE_COLOR;
FastLED.show();
fadeall();
}
delay (30);
}
Here’s an example of using EVERY_N_MILLISECONDS. Note that I put the FastLED.show(); in the main loop; and I don’t use delay’s at all.
but using this function instead the delays i cant control the speed of the animations that i want to loop in the case, and when i try to do that those 2 animations just run with the same speed instead of having 2 different speeds
Not if you use two instances of that function; one for each loop.
You should also look into learning how to program non-blocking delays.
In my case, I’ve had to completely re-write routines based on new found knowledge. I suspect that will be the same with yourself.
I highly recommend that you check out and learn various FastLED examples that are online.