A pushbutton on a lead for when you need another pushbutton or you want it away from your micro:bit
One lead goes on 3v or GND and the other lead goes on 0, 1, or 2. For advanced applications it is feasible to connect two pins with the pushbutton. It will short circuit the micro:bit if connected between 3v & GND and the button is pressed.
Use the digital input block to read the sensor value:
You can use any one of the three pins 0, 1 or 2.
If the other lead is connected to 3v, the pin will register a 1 when the button is pressed.
If the other lead is connected to GND, the pin will register a 0 when the button is pressed. However as the pins default to a 0, this will only work if the pin has something causing it to normally be kept high – a direct connection to 3v and pushing the button will cause a short-circuit.