I'm trying to build a latching switch connected to a door and would appreciate ideas.
The switch is connected to a microcontroller input pin, and I'd like it to operate as follows: When a person opens and closes the door, it latches on. It remains on until it is reset in software.
The basic idea is to time how long since the door was opened and closed again, and do something based on that. Once I have done this, I can reset the switch again. It does not matter if the door is opened or closed several times.
I'm not sure where to start, so any ideas welcome.