Slide 44
Slide 44 text
44
We can set a GPIO pin to INPUT mode.
If we don’t push the button, the GPIO pin “floats”. It is neither always
HIGH nor always LOW, it has an undefined state that may be
affected by static electricity.
We can enable internal pull-up resistors to make the pin HIGH by
default.
button = 8
GPIO.setup(button, GPIO.IN, GPIO.PUD_UP)
Reading Input