A c class for de-bouncing a mechanical switch.
The parameters are the GPIO pin #, a flag that's true if using an internal pullup resistor, a pair of callback functions that get called when the pin goes either high or low, and a debounce delay in ms.
▪️ The initPin() function must be called first. It configures the input pin, and returns the inital state of the switch.
▪️ The readPin(int debounceDelay) function returns the current state (de-bounced), and calls the corresponding callback function whenever the state changes.
Source: https://www.mischianti.org/2021/04/26/wemos-d1-mini-high-resolution-pinout-and-specs/
Source: https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/
Source: https://forum.fritzing.org/t/esp32s-hiletgo-dev-boad-with-pinout-template/5357