🌐
PyPI
pypi.org › project › RPi.GPIO
RPi.GPIO · PyPI
This package provides a Python module to control the GPIO on a Raspberry Pi.
      » pip install RPi.GPIO
    
Published   Feb 06, 2022
Version   0.7.1
🌐
Geekworm Wiki
wiki.geekworm.com › How_to_Install_RPi.GPIO_Python_Library
How to Install RPi.GPIO Python Library - Geekworm Wiki
This will now mean you can use the library within Python. import RPi.GPIO as GPIO # to use Raspberry Pi board pin numbers GPIO.setmode(GPIO.BOARD) # set up the GPIO channels - one input and one output GPIO.setup(11, GPIO.IN) GPIO.setup(12, GPIO.OUT) # input from pin 11 input_value = GPIO.input(11) # output to pin 12 GPIO.output(12, GPIO.HIGH) # the same script as above but using BCM GPIO 00..nn numbers GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.IN) GPIO.setup(18, GPIO.OUT) input_value = GPIO.input(17) GPIO.output(18, GPIO.HIGH) ‎ ·
Discussions

Can't control GPIO through python or C
Have you tried a different pin? GPIO4 is the default 1-wire pin. More on reddit.com
🌐 r/raspberry_pi
22
4
March 15, 2024
Control Pi 2 GPIO pins through Python
Here's a good pinout guide: http://pi.gadgetoid.com/pinout and here are some input examples for using the RPi.GPIO Python library: http://sourceforge.net/p/raspberry-gpio-python/wiki/Inputs/ More on reddit.com
🌐 r/raspberry_pi
2
5
August 23, 2015
A GUI for the GPIO pins
I made a Python script that creates a graphical interface for the Pi's GPIO pins. I hope this is useful for people who are debugging a program using GPIO pins and / or people who want to use the GPIO pins without writing any code. You can either import the script into other Python programs or run it independently to manually control each pin. Please let me know if you have any questions. I have ideas to improve the program (adding PWM controls, add the ability to name pins, add the ability to save and load pin configurations, etc) but wanted to gauge interest before putting more time into the project. I wrote it on a Pi3 running Stretch so I'm not sure if it will work on other models / OS versions. Let me know if you try it on something else! The file can be found here: https://github.com/evanmoring/GPIOGUI Thanks for looking! More on reddit.com
🌐 r/raspberry_pi
12
87
October 11, 2019
[DIY] Use Python to Control the Pins of a Raspberry Pi to Light Up LEDs
No hate, but wouldn't this be a better project for an arduino? I don't think you need a quad core with giga bytes of ram to light up a led. An arduino uno is like 3 dollars on eBay, which makes it a much more affordable option for something like blinking LEDs. More on reddit.com
🌐 r/RASPBERRY_PI_PROJECTS
8
60
September 25, 2019
🌐
Viktooor
viktooor.com › crating-a-python-script-to-control-the-gpio-of-the-raspberry-pi
Crating a Python script to control the GPIO of my Raspberry Pi - viktooor.com - Tech Blog from Hungary
September 21, 2025 - pi@raspberrypi:~ $ influx Connected to http://localhost:8086 version v1.11.8 InfluxDB shell version: v1.11.8 > CREATE DATABASE temp_meas > SHOW DATABASES name: databases name ---- _internal temp_meas · Remember these, later we'll refer back to these in the Python script. That's all we need to do beforehand, now we can run the script. You can download this from my Github repo, but I also paste it here: import RPi.GPIO as GPIO import time from influxdb import InfluxDBClient from w1thermsensor import W1ThermSensor #USER INPUTS: #SPECIFY THE TARGET TEMPERATURE IN CELSIUS, #THE HYSTERESIS IN CELSI
🌐
NiceGUI
nicegui.io
NiceGUI
NiceGUI is an easy-to-use, Python-based UI framework, which shows up in your web browser. You can create buttons, dialogs, Markdown, 3D scenes, plots and much more.
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › python
What is the official Raspberry Pi library for accessing GPIO ports ? - Raspberry Pi Forums
September 14, 2024 - GPIO Zero is the recommendation in the official OS documentation: Use GPIO from Python. It should be installed by default with RPi OS 12/Bookworm. N.B. The hardware implementation of GPIO changed with the Pi5, so various other libraries won't work on the Pi5 until the library developers update ...
🌐
Medium
medium.com › writearobot › basic-setup-and-working-with-raspberry-pis-rpi-gpio-module-of-python-d6bb3ea0d9ea
Basic setup and working with raspberry pi’s RPI GPIO Module of python | by Surya Teja | writearobot | Medium
April 17, 2018 - RPI GPIO Module is a third party package which can be used to configure and control the GPIO pins. The basic setup is pretty easy. After setup we define whether a pin’s value should be high or low.
🌐
The Pi Hut
thepihut.com › home › the pi hut tutorials › how to install the gpio python library
How to Install the GPIO Python Library
July 3, 2019 - If you wish to create a program ... library. The RPi.GPIO Python library allows you to easily configure and read-write the input/output pins on the GPIO header within a Python script....
Find elsewhere
🌐
Raspberry Pi
projects.raspberrypi.org › en › projects › physical-computing › 1
GPIO pins - Physical Computing with Python
Learn how to use the GPIO pins on your Raspberry Pi to interface with electronic components, such as LEDs and PIRs. As well as a Raspberry Pi with an SD card and the usual peripherals, you’ll also need: There are no additional software requirements for this resource beyond what is pre-installed in the current Raspbian image. Know how wire a variety of components to the Raspberry Pi · Know how to interact with a variety of components using Python
🌐
Jeff Everhart
jeffreyeverhart.com › home › using cleanup method rpi.gpio | raspberry pi tutorial
Using cleanup method RPi.GPIO | Raspberry Pi Tutorial - Jeff Everhart Jeff Everhart
August 28, 2017 - If you look at the example code ... on the GPIO object to make sure all of the pins are reset every time you end a Python script. Not only does it make your code better to have some type of error checking implemented, it could also save you a pin or some boards down the line. I’ll be posting more frequently on the Raspberry Pi, future ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › introduction-to-python-raspberry-pi-rpigpio-library
Introduction to Python Raspberry Pi (RPiGPIO) Library - GeeksforGeeks
July 23, 2025 - The RPi.GPIO module is a Python library that allows us to easily control the GPIO pins on a Raspberry Pi. It provides a simple interface for configuring the pins as inputs or outputs, reading their state, and controlling them.
🌐
Ubuntu
ubuntu.com › tutorials › gpio-on-raspberry-pi
How to use Raspberry Pi GPIO pins with Ubuntu | Ubuntu
But fear not, there is a new package in Ubuntu 21.04 called LGPIO that allows full control over the header pins with the latest kernel version. This tutorial covers some basic functionality of LGPIO, including examples using basic GPIO control, I²C, PWM, and SPI. If you already have Ubuntu 21.04 or newer set up on a Raspberry Pi, you are ready for this tutorial.
🌐
FactoryForward
factoryforward.com › home › blog › raspberry pi
Getting Started with Raspberry Pi GPIO Programming using Python – FactoryForward
July 4, 2018 - For some Raspbian Lite Versions, the Python 3 is not included. To install Python3 manually on Raspbian, use the following command. ... The RPi.GPIO is a package for accessing the Raspberry Pi GPIO Pins.
🌐
Raspberry Pi
raspberrypi.com › home › news › gpio zero: a friendly python api for physical computing
GPIO Zero: a friendly Python API for physical computing - Raspberry Pi
September 19, 2021 - Physical computing is one of the most engaging classroom activities, and it’s at the heart of most projects we see in the community. From flashing lights to IoT smart homes, the Pi’s GPIO pins make programming objects in the real world accessible to everybody. Some three years ago, Ben Croston created a Python library called RPi.GPIO, which he used as part of his beer brewing process.
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › using the raspberry pi › beginners
Toggling Pi4 GPIO Outputs with Python? - Raspberry Pi Forums
## Toggle on/off (momentary) button to toggle the on/off state of an LED Light ##ledbutton.py # The button switches to Ground (active_low) with integral pullup resistor (pin 10) # The resulting output gives 3.3v on pin 12 to the LED # remember to fit a current limiting resistor to the LED!! import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.setup(10, GPIO.IN, pull_up_down=GPIO.PUD_UP) #Button to Pin 10 GPIO.setup(12, GPIO.OUT) #LED to Pin 12 try: times = 0 debounce = 2 state = True previous = False while True: reading = GPIO.input(10) if reading == False
🌐
Instructables
instructables.com › circuits › raspberry pi
Raspberry Pi: Python Scripting the GPIO : 8 Steps (with Pictures) - Instructables
October 17, 2017 - Raspberry Pi: Python Scripting the GPIO: The GPIO: General Purpose Input/Output lets you interface your Raspberry Pi with the outside world, making it a powerful interactive device for just $40-$50.
🌐
Regent Electronics
regentelectronics.com › home › blogs › how to work with raspberry pi 4 gpio using python
How to Work with Raspberry Pi 4 GPIO Using Python - Regent Electronics
March 26, 2025 - ... This script turns an LED on and off with a 1-second delay. ... Raspberry Pi 4 GPIO provides vast possibilities for electronics projects. With Python programming, you can easily control sensors, modules, and other peripherals.
🌐
PCBSync
pcbsync.com › home › raspberry pi information › python gpio tutorial: control leds, buttons, and sensors on raspberry pi
Python GPIO Tutorial: Control LEDs, Buttons, and Sensors on Raspberry Pi - PCBSync
January 21, 2026 - Learn Raspberry Pi GPIO Python programming with this complete tutorial. Control LEDs, read buttons, interface sensors, and drive servo motors step-by-step.
🌐
Raspberry Pi
projects-raspberry.com › using-the-raspberry-pi-gpio-with-python
Using the Raspberry Pi GPIO with Python
May 17, 2023 - The easiest way to control these pins is to use the RPi.GPIO Python library. The library comes pre-installed with the latest Raspbian OS. In any case, we’ll learn how to install the library, just in case you find it missing.
🌐
Phazertech
phazertech.com › tutorials › rpi-gpio.html
GPIO Python Guide
July 6, 2024 - It turns out python3-RPi.GPIO isn't compatible with the Pi 5 but there's a drop-in replacement called rpi-lgpio and it's compatible with all Raspberry Pi versions. If you previously installed python3-RPi.GPIO, make sure you uninstall it first before installing rpi-lgpio.
🌐
Tom's Hardware
tomshardware.com › maker and stem › microcontrollers
How to Control the Raspberry Pi 5 GPIO with Python 3 | Tom's Hardware
October 28, 2023 - With the Raspberry Pi 5, we are ... alternative, and libgpiod is the focus of this how to. ... python3-gpiod is a pure Python module for interacting with the GPIO....