Doug101:
I'm using a for loop to light LEDs 2 -42 on a 2560 in sequence.I know this could be done with an array. But can it be done with a for loop?
For the first itteration of the loop I would like to start at LED 22 or +20.
Next and all future itterations from 2.There's not offset in a for loop correct?
I'm trying to think though the logic on this.byte i = 22; //Initial setting of i to 22 This woud be in the global area or above setup.
void setup () for (i; i <=42 ; i = i + x) { // First interation of loop i starts at 22. } i=2; // I is now set to 2 so next itteration and all future itterations of the loop are from 2. Woudl this work? Or is there a better way?
For the second itteration would it start at 2 or 22?