For loop not incrementing - Led Strip

Why do you think the for loop isn't incrementing?
Does that seem a likely thing?

Hi TolpuddleSartre, I'm not quite sure I understand the comment, to my understand i should be incrementing by 1 every time the for loop runs?

Have you considered the number of times that for loop will complete in one second?

My thinking is that the below bit of code would control the timing and result in a 1 second delay before running the for loop again. When I check the status of i in the serial monitor I can see that the loop is running once per second, however i stays at 0.

 for (int i = 0; i < NUM_LEDS; i++) {                  // i = Led number
    if (currentMillis - previousMillis >= interval) {
      previousMillis = currentMillis;

I feel as though I am missing something very basic....

Hi gfvalvo

Good attempt, but has some problems. Try something like this (untested, but it compiles):

I have tried your code and it does exactly what mine was intended to do, I have also read through it and understand the approach which you took. Thank you.

But please comment on where my attempt is failing as I would like to understand what I am doing wrong?

Thanks.