first a bit of the kit. This is for LPD6803 LED pixel strings. Using IDE 1.01, arduino pro mini, 80 pixels, rotary encoder, DS2331 Real Time CLock.
What I am doing with this code:
I send this chunk a few variables to control which LEDs are on and when. (digits, a,b,c,d)
setCircle(); calls a subroutine to advance the position of a lit LED in a circle of 20 leds (the last 20 on the string)
what I am trying to do: eliminate the delay(); statement, as it affects the speed of the setCircle routine (which is already has no delay()'s.
what am I missing? can you manipulate the for()'s variable.
I know about wait without delay, I'm using it in the setCircle() routine, But I don't get how to manage within a loop, and still do the full loop count (30 in this case)...
it couldn't be as simple as a millis() based i-- command, could it?
// goes forwards
for (int j = 0; j < digits; j++)
{
c = a + 1;
d = b - 1;
for (int i = 0; i < 30; i++)
{
strip.setPixelColor((a-i)%60, i, 30-i, 0);
strip.setPixelColor((b+i)%60, i, 30-i, 0);
delay((i*2));
strip.setPixelColor((c-i)%60, 0, 0, 0);
strip.setPixelColor((d+i)%60, 0, 0, 0);
strip.setPixelColor(digits*5%60,31,0,0);
setCircle();
strip.show();
}