MCPcopy Create free account
hub / github.com/FastLED/FastLED / Pir

Method Pir

src/fl/sensors/pir.cpp.hpp:40–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38
39
40Pir::Pir(int pin, u32 latchMs, u32 risingTime,
41 u32 fallingTime, const char* button_name)
42 : mPir(pin), mRamp(risingTime, latchMs, fallingTime), mButton(getButtonName(button_name).c_str()) {
43 mButton.onChanged([this](UIButton&) {
44 this->mRamp.trigger(fl::millis());
45 });
46}
47
48bool Pir::detect(u32 now) {
49 bool currentState = mPir.detect();

Callers

nothing calls this directly

Calls 5

getButtonNameFunction · 0.85
millisFunction · 0.50
c_strMethod · 0.45
onChangedMethod · 0.45
triggerMethod · 0.45

Tested by

no test coverage detected