That code works OK on a pizero2 running Bullseye 32-bit with Desktop.
I simulate the reed switch on GPIO16 using raspi-gpio with the script already running:script prints:Of course, I would use gpiozero to check the input when pressed, rather than the tight loop...
Have you checked the reed switch with a multimeter - 0 ohms when closed, high resistance when open, using the magnet?
Edit: why are we in the Compute Module section?
I simulate the reed switch on GPIO16 using raspi-gpio with the script already running:
Code:
pi@pibull32:~ $ raspi-gpio set 16 op dhpi@pibull32:~ $ raspi-gpio set 16 op dl
Code:
Door is OPENDoor is OPENDoor is CLOSEDDoor is CLOSED...
Have you checked the reed switch with a multimeter - 0 ohms when closed, high resistance when open, using the magnet?
Edit: why are we in the Compute Module section?
Statistics: Posted by neilgl — Wed Aug 07, 2024 3:29 pm