Arduino Tutorial – digitalRead Serial Monitor with Button

Arduino Basic Tutorial digitalRead Serial Monitor with Button. Reads a digital input on pin 2, prints the result to the serial monitor.

 

When the pushbutton is open (unpressed) there is no connection between the two legs of the pushbutton, so the pin is connected to ground (through the pull-down resistor) and reads as LOW, or 0.
When the button is closed (pressed), it makes a connection between its two legs, connecting the pin to 5 volts, so that the pin reads as HIGH, or 1.

 

No Comment

Post A Comment

error: Context Menu disabled!