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

ComponentsAmazonamazonAliExpressali expressBanggoodebanggood
Raspberry Pi 3b+ cart iconcart iconcart icon
Micro Push Buttoncart iconcart iconcart 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 Comment

Your email address will not be published. Required fields are marked *