The microbit has the following connections:
3 pins
3v pin
A ground
When the circuit between one of the three pins and the ground connector is made the circuit is closed and the microbit can pick up on this signal with the following code:
if (input.pinIsPressed(TouchPin.P0)) {
//do something
}
We can set the pin number in the argument of the function
P0, P1, P2
Using this simple piece of code we could design other controllers for the microbit including foil pads to make a reation game, controls for a game, timing gate etc.