16 u32 elapsed = now - start;
17 u32 total =
end - start;
18 u32 out = (elapsed * 255) / total;
22 return static_cast<u8>(out);
32 u32 elapsed = now - start;
33 u32 total =
end - start;
34 u32 out = (elapsed * 65535) / total;
38 return static_cast<u16
>(out);
RampPhase getCurrentPhase(u32 now) const FL_NOEXCEPT
Get the current phase of the ramp.
TimeRamp(u32 risingTime, u32 latchMs, u32 fallingTime) FL_NOEXCEPT
u8 update8(u32 now) FL_NOEXCEPT override
Compute current 0–255 output based on how much time has elapsed since trigger().
bool isActive(u32 now) const FL_NOEXCEPT override
void trigger(u32 now) FL_NOEXCEPT override
Call this when you want to (re)start the ramp cycle.
Centralized logging categories for FastLED hardware interfaces and subsystems.
constexpr T * end(T(&array)[N]) FL_NOEXCEPT
u16 time_alpha16(u32 now, u32 start, u32 end) FL_NOEXCEPT
u8 time_alpha8(u32 now, u32 start, u32 end) FL_NOEXCEPT
Base definition for an LED controller.