Hello, I'm currently working on a project that makes LEDs run on the bottom

Hello,
I’m currently working on a project that makes LEDs run on the bottom of my Skateboard at the same speed as the board is running so it appears that the light is standing still.
I’m using magnets and a hall sensor to determine the speed and turn on the next LED after the board rolled the distance that is between every LED (1,6cm)
It is actually working really good, although I’m not happy with the way I did the animation.
Currently I’m turning on the next LED after a certain time and at the same time dim all LEDs to create that fading tail.
The code that pretty much controls the LEDs is here: https://pastebin.com/crm76hgg

In motion and in the dark it looks weird when it starts really bright on one side and is fading on the other end of the board so I’m currently thinking about having this fading “tail” in front and after that moving dot, but I can’t really come up with a clever solution that is not brute force, so I’m asking here for help.
I just need an idea how it could work out, I’m not asking you to program it for me, but I would really appreciate it if you could point me in some kind of direction, because I really want to improve my programming, but right now I’m stuck and have no idea how to realize this.

Thanks for reading and thank you in advance for your help :slight_smile:
https://photos.app.goo.gl/xOcrECi1pPemJKCe2

Maybe instead of using nscale8 have the brightness value based on an equation and the position along the strip?

Sudo code example for a 40 pixel strip:

if i <= 8
value = 30 * i

else if i > 8 && i <= 25
value = 255

else if i > 25
value = 255 - (i-23 * 15)

leds[i] = CHSV(255+turning, 255, value);

Then sweep a square wave down the strip at the appropriate speed and the values should result in something like this:

Or maybe use a FastLED wave function:

@marmil using the wave function might actually be a good idea, I’ll try it later and maybe I’ll be able to come up with a solution, thanks