Buttons and switches

Many projects include physical buttons or switches of some kind. The basic principle is simple: Two wires are disconnected until the switch connects them, closing the circuit. (Sometimes the principle is inverted, where the circuit is closed by default and pushing a button opens the circuit until it's released.)

On the software side, you just check whether the signal pin is in a LOW or HIGH state, and branch accordingly.

Subscribe to switches