What you’re quite possibly missing is the fabled pull-up resistor, or some way of giving your input a “normal” state.
What I think is happening is this ( excuse my use of probably horribly incorrect use of the word charge! ):
- Input is 1 because it’s “floating” and happens to have just enough charge to read high
- You press the button and ground input, removing all charge
- When the button is released, there’s no path to return the input back to high so it stays low
You need a very weak ( 10k is a popular choice ) resistor which connects between your button and the input, and to +5v. This is called a “Pull Up” resistor. It does just that- very weakly pulls the line back up to 5v when it’s no longer grounded.
When your button is pressed, the pull up resistor is too weak to raise the line to high, current just flows through and straight to ground via the path of least resistance.
The Pi has built in pull ups that usually solve this problem for you, but since Explorer HAT has an input buffer and the pull ups are on the other side of that buffer, they don’t work in this case.
Here’s a random, but applicable diagram I borrowed from the internet: