Uses a HC-SR501 motion detector to keep LCD screen alive, then turns it off when no activity is detected for the specified amount of time.
Tested with Raspian buster, and Waveshare 7inch HDMI LCD (C).
Modify screen.py
's ON and OFF behavior according to your needs. The default may or may not work for you.
Start with:
./motion.py <args>
--pin
: the GPIO pin of the motion detector (required)--timeout
: the timeout in seconds for the screen to turn off after motion (optional, default: 120)--verbose
: activates verbose mode for motion detection (optional, default: off)
./motion.py --pin=18 --timeout=300