FastLED 3.10.6
Loading...
Searching...
No Matches

◆ advanceLinearFade()

float advanceLinearFade ( float value,
float target,
float durationSeconds,
float deltaSeconds )
Examples
hydropack.ino.

Definition at line 217 of file hydropack.ino.

218 {
219 if (durationSeconds <= 0.0f) {
220 return target;
221 }
222 const float step = deltaSeconds / durationSeconds;
223 if (target > value) {
224 return fl::min(target, value + step);
225 }
226 return fl::max(target, value - step);
227}
constexpr common_type_t< T, U > max(T a, U b) FL_NO_EXCEPT
Definition math.h:75
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NO_EXCEPT
Definition math.h:71
constexpr enable_if< is_fixed_point< T >::value, T >::type step(T edge, T x) FL_NO_EXCEPT

References fl::max(), and fl::min().

Referenced by loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: