I am very new to raspberry pi (though I've had one for years, I haven't done much with it and I am looking to change that). I've been playing with an idea I have for Halloween using the pi and a pir. (I got some 1-way mirror and an old monitor that I'll combine as if making a smart mirror and then when the pir detects a tricker treater, it displays a video on the screen that looks like a ghost coming through the mirror.) I've got a 4b fully up to date plugged into the screen using a mini-hdmi-to-hdmi cable and I've got the pir installed and working. (To make things easier on myself, as I've been learning more and more, I've kept each task as a separate script and so for this question, I'm only referencing the part of my script that applies.) What I'm looking to do is blank the screen when there is no motion detected unblank it rotated left, when there is motion. My script seems to work:
The screen turns off when the pir detects nothing and on rotated left when it does, but I get an error:
Code:
from gpiozero import MotionSensorfrom subprocess import runpir = MotionSensor(12) # out plugged into GPIO12while True: pir.wait_for_motion() run('WAYLAND_DISPLAY="wayland-1" wlr-randr --output HDMI-A-1 --on --rotate left', shell=True) pir.wait_for_no_motion() run('WAYLAND_DISPLAY="wayland-1" wlr-randr --output HDMI-A-1 --off', shell=True)
If I leave off thewlr-randr: unrecognized option '--rotate'
the screen doesn't rotate when it turns back on. While I could ignore the error (since everything seems to be working the way I want it to) I feel like I'm missing out on the learning. What am I doing wrong here?--rotate left
Statistics: Posted by arielzusya — Sun Oct 13, 2024 7:20 pm — Replies 0 — Views 13