Push buttons
Push buttons are commonly used in switching operations. Electrical buttons are used in any electronics circuit when switching (on/off) functions need to be performed. Let us consider a scenario where an electrical bulb needs to be turned on or off; we usually go to a switchboard and press the button. It changes the state by moving to an open circuit. This can be done through the Micro:bit. The advantage it offers is that it can be controlled through the program.
The basic principle behind push buttons is to control the current’s flow through pushing or pressing motions. A switch is considered on when it allows the flow of the current, so the circuit will be closed. In the off state, it breaks the current’s flow, so the circuit will be open. There are various types of switches, as shown in Figure 7.1:
Figure 7.1 – Various types of switches – (A) push button, (B) slide switch, (C) DIP DPST switch, and (D) DIP SPST switch...