For loop not incrementing - Led Strip

Hi TolpuddleSartre,

By my understanding, it is.
I can see no proof from you to show that it is not.

See the attached screenshot of the serial monitor, each time 1000ms passes i remains at 0.

Hi Speklap

You don't update currentMillis.

What happens is

i = 0 -> the if statement is correct -> previous = current
i = 1 -> current - previous is always zero -> if statement false
i = 2 -> if statement false
...

When you finish the for loop, then your currentMillis gets updated.

Try to rewrite this.

From the screenshot you can see currentMillis is indeed updating.

Regardless I did try moving the unsigned long currentMillis = millis();
around in the program however this did not help.

Thanks for the input guys.

Still trying to figure this out. :cold_sweat: