Hi i’m sorry if this has already been answered. I am struggling to find answers in this forum or on google. I have my WS2812B strip wrapped around the edge of a pool table. I want to have the animations start at the corner of the pool table but that is not where the strip starts. I think the easiest conceptual way of doing this is to have the beginning of the leds array to start at a different position other than 0.
Basically lets say the corner of the table is at leds[400] so I would like leds[0] to map to led number 400 and leds[1] map to led 401 and so on. Is there an easy way to either change the starting position of the leds array or shift the values in leds to a new array.
I hope this question makes sense. and somebody can point me in the right direction. Thank you
Another option (that uses a bit more memory) is to use a second array that you copy your leds data to with the offset before displaying. Here’s some example code:
Thanks for the quick responses guys! Thats really quick turn around.
The way I ended up doing it was creating a method called
int getRealPosition(int i){
if(i >= 88){
return i - 88; //88 is the number of LEDs from
//the end of the strip
}
return startPos+i; //startPos = NUM_LEDS-88
}
Now I call leds[getRealPosition(i)] = CRGB::Blue;
I may still try using modulo just for some more practice with it.