Writing the Python program to read the GPIO pin When you hook up the circuit you can use the following reference to diagram to find the correct pin numbers. When the button is pushed it will connect the pin to 3.3V and change the state to high (3.3V). The idea is that the input pin will be low (0V) when the button is not pushed. The resistor is used as a current limiting resistor to protect our input pin by limiting the amount of current that can flow. The other side of the switch we connect to 3.3V on pin 1 using a resistor. We connect one side of the switch to an input pin on the Raspberry Pi, in this case we use pin 10. Raspberry Pi 3 (or newer) or Raspberry Pi Zero setup with monitor and USB Mouse & KeyboardĬonnecting the Raspberry Pi’s general purpose input output ports (GPIO) to a momentary tactile push button switch is a fairly simple circuit.We will need the following tools to complete the project: Integrating the button with Python allows you endless possibilities of actions to execute on a button press. This guide will guide you through setting up the circuit with the Raspberry Pi and reading the state of the button in Python. A great starter hardware project using the Raspberry Pi is hooking up a simple tactile switch to the Raspberry GPIO and detecting button presses in Python.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |