FastLED 3.10.8
Loading...
Searching...
No Matches

◆ detect()

bool fl::Pir::detect ( u32 now)

Returns true if the PIR is “latched on” (within latchMs of last trigger).

Definition at line 56 of file pir.cpp.hpp.

56 {
57 bool currentState = mPir.detect();
58 if (currentState && !mLastState) {
59 // Use smart retrigger to avoid resetting brightness when already active
60 mRamp.trigger(now);
61 }
62 mLastState = currentState;
63 return mRamp.isActive(now);
64}
PirLowLevel mPir
Definition pir.h:65
TimeRamp mRamp
Definition pir.h:66
bool mLastState
Definition pir.h:67

References fl::FL_NO_EXCEPT, mLastState, mPir, and mRamp.

Referenced by transition().

+ Here is the caller graph for this function: