Push buttons and Switches are digital inputs and are widely used in electronic projects as most systems need to respond to user commands or sensors. Reading a push button is very useful because a push button is widely used and can also represents a wide range of digital devices in real world like switches, limit sensors, level switches, proximity switches, keypads (a combination of switches) etc.
In this case, we’re going to use the simplest form of sensor: a push button switch. In this tutorial we are going to learn Arduino functions to read a switch connected to Digital Inputs pins.