FastLED 3.9.15
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 48 of file pir.cpp.hpp.

48 {
49 bool currentState = mPir.detect();
50 if (currentState && !mLastState) {
51 // Use smart retrigger to avoid resetting brightness when already active
52 mRamp.trigger(now);
53 }
54 mLastState = currentState;
55 return mRamp.isActive(now);
56}
PirLowLevel mPir
Definition pir.h:64
TimeRamp mRamp
Definition pir.h:65
bool mLastState
Definition pir.h:66

References mLastState, mPir, and mRamp.

Referenced by transition().

+ Here is the caller graph for this function: