Digital debounce on switch input

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
clintebbesen
New user
Posts: 5
Joined: 26 Sep 2016, 02:08

Digital debounce on switch input

#1 Post by clintebbesen » 28 Sep 2016, 01:07

Hi,

On GPIO 0 and 2, I have two reed switches between ground and the input pin. One reed switch is mounted under a normal door with a magnet on the bottom of the door, that works fine, the other is mounted next to where a sliding door closes, with a magnet on the side of the sliding door. Its just a hanging sliding door, so it moves obviously left/right, but it also has a bit of play front to back, and I think that may be part of cause of my issue..

When closing the sliding door, the reed switch triggers on, off, then back to on where it stays as long as the door is closed. it does this pretty much every time.

I need a way to have something like a debounce setup on it, would be great to do it from the switch settings in espeasy, just enter say 500ms as the debounce time and it would then ignore the on/off/on again and just have a single on when closing the door.

Ive seen there is digital debounce for other types, Pulse or PWM i think it was, any chance of having it for a switch input?

uhrheber
Normal user
Posts: 22
Joined: 26 Sep 2016, 14:03

Re: Digital debounce on switch input

#2 Post by uhrheber » 28 Sep 2016, 15:13

The switch is already debounced, otherwise it would trigger multiple events with a normal switch.
So there must be a debounce time defined in the source, that you could alter.
Otherwise, you could use a timer in the rules for that.
Trigger the timer when the switch closes, and when the timer has expired, check that the switch is still high, and only then start the action.

Post Reply

Who is online

Users browsing this forum: No registered users and 52 guests