The push button module is a switch to close a circuit when you press the button. The module has 3 pins and can be configured as a pull-down resistor or pull-up resistor. A pull-down resistor is used to make the default state of the digital pin as Low or tothe logic level in 0V value, while a pull-up resistor is used to make the default state of the digital pin as High or to the logic level in 5V value.
I made a short sample of the push button module code. See the code below. In this code, the input will be read in the digital pin 4, and the output will be in the digital pin 13. When the input reads LOW signal, there is no light display in LED. But when the input reads HIGH signal, there should be light display in LED. Let us upload the code (sketch) to the Arduino so we could test it.
There it goes. We will discuss another sensor to our next article.