SunFounder 3in1 Kit
One side of the button pin is connected to 5V, and the other side pin is connected to pin 2, so when the button is pressed,
pin 2 will be high. However, when the button is not pressed, pin 2 is in a suspended state and may be high or low. In
order to get a stable low level when the button is not pressed, pin 2 needs to be reconnected to GND through a 10K
pull-down resistor.
Wiring
108 Chapter 4. Basic Projects