Difference between INPUT, INPUT_PULLUP & INPUT_PULLDOWN

When in any `INPUT´ mode the pin goes in a high impedance state which means that it should (almost) not influence the external circuitry and for this the signal to read.

If there is no ext circuitry attached INPUT will not give you any predictable reading (floating signal).

To prevent this floating you can instruct the µP to internally attach a somewhat lower (but still high) resistance either towards GND (INPUT_PULLDOWN) or towards Vcc (INPUT_PULLUP).
This will give you predictable readings e.g. when an attached switch is not pressed.

3 Likes