I have a ring of 14 WS2812B LEDs (think NeoPixel ring, but DIY). I am trying to write code so that a single “glow” can be at any point of the ring and have a variable width, and the LED at the middle of the glow will be brighter than the ones each side of it. I’ve tried multiple things but I just can’t get one that works.
To add to this, 14 LEDs isn’t very much so I want to make sure that the centrepoint of the glow can be between LEDs so there’s never a sharp change as the glow moves slowly around the ring (the movement I’ll approach later).
Just to further explain - the output would be something like this…
Glow centre 5th LED 0 0 0 64 128 255 128 64 0 0 . . . Glow centre 5.5th LED 0 0 0 32 64 200 200 64 32 0 . . .
In addition, it must wrap smoothly between the last and the first LED.
In my (unsuccessful) code I’ve mostly tried having the glow centre expressed as a uint8_t between 0 and 255 in the hope that I can use the rollover between 255 and 0 to make things simpler.
I’ve tried a sine wave limited to one period by if statements, an approximated linear smoothing, and even polynomials, but they all have funky artifacts and/or don’t loop. For the purpose of working it out I’m working in floating points (I can optimise later).
So basically…any suggestions? Or previous work that might help (I have tried googling)?