Hi,
I’m using a 144 Neopixel strip with an Arduino Nano. I have the library up and running (it’s amazing!) but have hit a stumbling block with what I want to do.
The effect I’m trying to achieve is a particle which I can move up and down the led strip and vary its size. The way I thought of doing this was to specify a target pixel and a size. For example I might have an array like this: [pos, size]. With the array set as [6, 2], pixel 6 and two pixels either side would light ( pixel 3,4,5,6,7 would be lit). I’d then be able to move the ‘particle’ around and change it’s size by modifying these variables. I’d then interpolate colour values from the target pixel to the size variable left and the same for right. I can do all this, but the problem I have is ‘wrapping’. For example when I move the particle to the end of the strip, pixels will ‘fall off’ and I can’t get them to wrap around to the beginning of the strip. I experimented with modulo but with no luck.
So I guess my questions are, am I approaching this in the right way? Is there something in the library that might make it easier for me to do this? If the way I’ve explained is a reasonable way for me to do this, how can I wrap the pixels that fall off?
Thanks in advance for any advice.