The need for pull-up resistors




This hardware operates as follows:
• When the switch is open, it has no impact on the port pin.
An internal resistor on the port ‘pulls up’ the pin to the


supply voltage of the microcontroller (typically 5V). If we
read the pin, we will see the value ‘1’.
• When the switch is closed (pressed), the pin voltage will be
0V. If we read the the pin, we will see the value ‘0’.