I want to move an LED up and down the strip.

I want to move an LED up and down the strip.
I already managed to get this right to control the LED with a poti but I want it to leave it some kind of fading trail.
So I thought to myself, that I should use a for loop to always dim all leds on the strip to black. The one, who my poti controls gets the new hsv value anyway.

So I tried this:
for(int x = 0; x >= NUM_LEDS; x++){

leds[x].fadeToBlackBy( 64 );
}

leds[mapLeds] = CHSV(hue, saturation, 100);
FastLED.show();

The LEDs don’t dim down. I can move my LED up and down the strip until all LEDs are on. What am I missing here?
I’m thankful for any help.

complete code is here: http://pastebin.com/Y3RDHeRz

Start by changing from…

for(int x = 0; x >= NUM_LEDS; x++){

to…

for(int x = 0; x < NUM_LEDS; x++){

Also, you will need some kind of delay after the FastLED.show(); if you want to see a slowly fading trail !

I would try the blur functions too:

// blur1d: one-dimensional blur filter. Spreads light to 2 line neighbors.
// blur2d: two-dimensional blur filter. Spreads light to 8 XY neighbors.
//
// 0 = no spread at all
// 64 = moderate spreading
// 172 = maximum smooth, even spreading
//
// 173…255 = wider spreading, but increasing flicker
//
// Total light is NOT entirely conserved, so many repeated
// calls to ‘blur’ will also result in the light fading,
// eventually all the way to black; this is by design so that
// it can be used to (slowly) clear the LEDs to black.
void blur1d( CRGB* leds, uint16_t numLeds, fract8 blur_amount)

Ahh, so I only messed up the for loop. Alright, thank you, JP

@Felix_Puttner Don’t worry :wink: Those kind of small mistakes happen to me all the time !!!