I'm experimenting with GPIO interrupts on my RockPro64. I used the "Watching buttons" example from here: https://www.npmjs.com/package/epoll, but I changed the pin number to 156 (GPIO4_D4, pin 31 on the header).
The hardware is as follows: there's a mechanical switch between the supply (a buck converter with 3V output) and GPIO4_D4 and a 10k pull-down resistor between GPIO4_D4 and ground.
My issue is that when the button is released, the script just constantly spits out "released" (falling edge) events as fast as it can. When I close the switch, I get a couple of rising edge events, then a few falling edge events and then again a few rising edges. Then rising edge events pop up occasionally while the switch is still closed. I also found out that if I connect GPIO4_D4 directly to ground (with the switch open), the falling edge interrupts aren't emitted as frequently.
I'm aware of the fact that mechanical switches have contact bouncing, but is it normal that the events are repeated several times? Has anyone made a working hardware and software setup to detect interrupts with RockPro64? I would appreciate if you share your experiences
Thanks!
The hardware is as follows: there's a mechanical switch between the supply (a buck converter with 3V output) and GPIO4_D4 and a 10k pull-down resistor between GPIO4_D4 and ground.
My issue is that when the button is released, the script just constantly spits out "released" (falling edge) events as fast as it can. When I close the switch, I get a couple of rising edge events, then a few falling edge events and then again a few rising edges. Then rising edge events pop up occasionally while the switch is still closed. I also found out that if I connect GPIO4_D4 directly to ground (with the switch open), the falling edge interrupts aren't emitted as frequently.
I'm aware of the fact that mechanical switches have contact bouncing, but is it normal that the events are repeated several times? Has anyone made a working hardware and software setup to detect interrupts with RockPro64? I would appreciate if you share your experiences
