Hi, and that’s a great question – a need for that sort of ‘damped following’ shows up more often than you might expect!

There’s no function like this built into FastLED at the moment. I usually use something like this as my helper function:

uint8_t moveToward8( uint8_t current, uint8_t target, uint8_t maxmove)

{

// If current is already at target, just return it.

if( current == target) {

return current;

}

uint8_t delta;

uint8_t newvalue;

if( current < target) {

```
// current is less than target,
// so compute amount to add;
delta = target - current;
delta = scale8( delta, maxmove);
delta = delta + 1; // move by at least 1
newvalue = current + delta;
```

} else {

```
// current is greater than target,
// so computer amount to subtract
delta = current - target;
delta = scale8( delta, maxmove);
delta = delta + 1; // move by at least 1
newvalue = current - delta;
```

}

return newvalue;

}

Then to use it, do this:

val = moveToward8( val, targetValue, 64);

If val is close to targetValue, it will move slowly. If val is far away targetValue, it will move more quickly. The “64” number there controls the maximum speed; I’d try different values between maybe 10-100, and see what you like.

Let us know if this helps, or what you wind up using instead!

(UPDATE: fixed a typo - oops!)