User Manual

24
Generally, the button can be connected directly to the LED in a circuit to turn on or off the
LED, which is comparatively simple. However, sometimes the LED will brighten automatically
without any button pressed, which is caused by various kinds of external interference. In
order to avoid this interference, a pull-down resistor is used usually connect a 1K–10KΩ
resistor between the button and GND. It can be connected to GND to consume the
interference when the button is off.
Use a normally open button as the input of Raspberry Pi. When the button is pressed, the
GPIO connected to the button will turn into low level (0V). We can detect the state of the
GPIO connected to the button through programming. That is, if the GPIO turns into low
level, it means the button is pressed. You can run the corresponding code when the button
is pressed, and then the LED will light up.