I want to utilise an RCWL-0516 motion sensor to turn off some LEDS.
If there hasn’t been movement detected (HIGH) for x amount of time (say 15minutes) then the LEDS turn off.
Basically, I believe I need to have a timer reset to 0 every time the RCWL-0516 reads HIGH. When the pin is LOW the timer starts until HIGH when it will reset.
In my application I can have the LEDs turn off if the timer is >15minutes (1000x60x15).
I have looked at the StateChangeDetection example, which I believe I can adapt, but I can’t figure how to incorporate a timer into the sketch.
Any help would be appreciated