Hello! I'm wondering if it's possible to change the pixel index number of individual

fastled-support
gplus
(Dylan Lovinger) #1

Hello! I’m wondering if it’s possible to change the pixel index number of individual or groups of pixels in a strip. By this I mean that LED #2 is normally the 2nd pixel in the strip, but I’d like to change this, such that writing to leds[2] would actually light a different LED of my choosing. This is because the layout of my project is a bit odd, so when running through a for loop over each pixel it would greatly simplify things to loop from 0 to n but actually light up pixels in a specific order e.g. 0-10, 20-30, 50-60, etc.

There are plenty of other ways to do what I’d like to do here, but most that I’ve come up with are inelegant and require a decent amount of added complexity. Ideas welcome. Thanks!

(Andrew Tuline) #2

I would use a lookup table for that functionality, i.e.

leds[myTable[2]]

(Dylan Lovinger) #3

@Andrew_Tuline This sounds like what I need, and far more efficient that throwing in a bunch of “if” statements. I’ll give it a shot, thanks!