FastLED 3.9.15
Loading...
Searching...
No Matches

◆ update8()

u8 fl::TimeRamp::update8 ( u32 now)
overridevirtual

Compute current 0–255 output based on how much time has elapsed since trigger().

Implements fl::TimeAlpha.

Definition at line 83 of file time_alpha.cpp.

83 {
84 if (!isActive(now)) {
85 return 0;
86 }
87 // u32 elapsed = now - mStart;
88 u8 out = 0;
89 if (now < mFinishedRisingTime) {
91 } else if (now < mFinishedPlateauTime) {
92 // plateau
93 out = 255;
94 } else if (now < mFinishedFallingTime) {
95 // ramp down
96 u8 alpha =
98 out = 255 - alpha;
99 } else {
100 // finished
101 out = 0;
102 }
103
104 mLastValue = out;
105 return out;
106}
u32 mFinishedPlateauTime
Definition time_alpha.h:81
bool isActive(u32 now) const override
u32 mFinishedRisingTime
Definition time_alpha.h:80
u32 mFinishedFallingTime
Definition time_alpha.h:82
unsigned char u8
Definition int.h:17
u8 time_alpha8(u32 now, u32 start, u32 end)
Definition time_alpha.cpp:8

References isActive(), mFinishedFallingTime, mFinishedPlateauTime, mFinishedRisingTime, mLastValue, mStart, and fl::time_alpha8().

+ Here is the call graph for this function: