This might be very simple and that is why I do not find code example...
I have magnet based contact sensor, that has two wires. Those sensors are typically used to check if doors/windows are close. Has two wires and I measure resistance between them with multimeter. It is infinity when there is no contact and close to zero when sensor gets contact.
How do I check with MP code if sensor contact is ON or OFF? It is on ESP32 board that I am trying to sense it. Should I connect one wire to 3,3V and another to analog or digital port? or two digital ports? How can I detect sensor status in code?
Detecting wire contact
Re: Detecting wire contact
Your reed switch magnet sensor is basically equivalent to a button, so you could follow this guide...
https://learn.adafruit.com/micropython- ... tal-inputs
https://learn.adafruit.com/micropython- ... tal-inputs