Has any one taken a strip of LEDs and started the light of a pallet from say 5 pixels in (on a 40 pixel strip) and have the light travel both ways and meet on the other side of the loop? I know how to go from say 5 LEDs in to the opposite side of the lop, but I am having difficulties processing or figuring out how to go from the 5 - > 0 and then 40- > 25 at the same time as going from 5 - > 25. Does that make sense?
http://pastebin.com/raw.php?i=idADbwuT
for(int i = 0; i < 20; i++) {
leds[4+i] = …
leds[39-i] = …
…
}
That affects led 4-24 and 39-20 at the same time. Counting starts with led number 0.
Hi, Stefan’s answer is on the right track !
However, I suggest the following lines that should be closer to what you want…
for (int i = 5; i<26; i++){
leds[i] = ??? ;
if (i>10) leds[50-i] = ??? ;
else leds[10-i] = ??? ;
}
Hope this helps !