Customer:
I’m interested in adding control buttons to Inkplate 10 with enclosure and battery. I plan to use ESPhome firmware and would like to connect external buttons similar to mini-button units. Can you provide more information on how to do this?
Originally submitted via email support on 6 October 2023. Migrated to the forum for community visibility.
Soldered Support:
To use external buttons, connect them to pins on GPIO expander 2, which has mostly free pins. Use the pinModeIO function to set them to INPUT_PULLUP, connect one pin to A and one pin to B, and connect GND to GND on the board. Use digitalReadIO to read the state of that pin in code.
The button will be logic level HIGH (3.3V) by default if it’s not pressed because it’s an input pullup. When the button is pressed, it will go LOW. To easily handle the reading of the button state you can just read when it’s LOW.
pinModeIO and digitalReadIO are functions in the Inkplate library which allow you to interface with the GPIO expanders. Check out the external GPIO expander example for GPIO expander 2: https://github.com/SolderedElectronics/Inkplate-Arduino-library/blob/master/examples/Inkplate10/Advanced/IO/Inkplate10_External_IO_Expander/Inkplate10_External_IO_Expander.ino