Raspberry Pi With Processing – Push Button – Lesson 3

In the third lesson, we are going to learn to interface a momentary push button with Raspberry Pi and program to display some output on the screen when the push button is pressed.

Hardware Required

Components
Amazonamazon
AliExpressali express
Banggoodebanggood
Raspberry Pi 3b+
cart icon
cart icon
cart icon
Micro Push Button
cart icon
cart icon
cart icon

Circuit

  • Connect the 3.3v of Raspberry Pi to one of the terminal of Push Button.
  • Connect the GPIO 4 (Physical pin 7) of Raspberry Pi to the other terminal of Push Button.
  • Connect a pull down resistor from GPIO 4 to GND.

Code

Output

When Button is released

When Button is pressed

Leave a Reply