I'm working with a project that has a handful of buttons connected to gpio lines. The buttons suffer from some bounce on push and release, and the project is destined to go into an electrically noisy environment. I'm trying to decide how to read these button inputs, in a reliable way that eliminates as much of the bounce/noise as possible. Unfortunately I've not got permission to change the physical hardware, so have to work with software only.
My first idea is to use the HMI interface (and lwgpio), but this doesn't incorporate any debounce capability, just reads directly from the gpio lines. So what is my best option? I could write a modified lwgpio driver layer, that debounces the inputs, and then use the HMI to interface with this. Or I could ignore the HMI / lwgpio altogether and just write my own routines. Has anyone tried either method with any level of success?
Thanks in advance,