SparkFun Learn
learn.sparkfun.com โบ tutorials โบ raspberry-gpio โบ python-rpigpio-example
Python (RPi.GPIO) Example - Raspberry gPIo - SparkFun Learn
language:Python # External module imports import RPi.GPIO as GPIO import time # Pin Definitons: pwmPin = 18 # Broadcom pin 18 (P1 pin 12) ledPin = 23 # Broadcom pin 23 (P1 pin 16) butPin = 17 # Broadcom pin 17 (P1 pin 11) dc = 95 # duty cycle (0-100) for PWM pin # Pin Setup: GPIO.setmode(GPIO.BCM) # Broadcom pin-numbering scheme GPIO.setup(ledPin, GPIO.OUT) # LED pin set as output GPIO.setup(pwmPin, GPIO.OUT) # PWM pin set as output pwm = GPIO.PWM(pwmPin, 50) # Initialize PWM on pwmPin 100Hz frequency GPIO.setup(butPin, GPIO.IN, pull_up_down=GPIO.PUD_UP) # Button pin set as input w/ pull-up # Initial state for LEDs: GPIO.output(ledPin, GPIO.LOW) pwm.start(dc) print("Here we go!
Raspberry Pi
projects.raspberrypi.org โบ en โบ projects โบ physical-computing โบ 7
Physical Computing with Python - Raspberry Pi Projects
We're sorry, but this site requires JavaScript to operate
RPi.GPIO equivalent in CircuitPython
There is an example on the Adafruit site. More on reddit.com
I just got a Raspberry Pi. What's the best way to learn how to use the GPIO interface?
If you're having trouble with the circuit side of things, I've made a few videos that go over the basics of using the GPIO pins. My students usually learn the following: GPIO header basics Light an LED using the 5V rail Use Python and a GPIO pin to control an LED There's also plenty of good videos from the Raspberry Pi V Beginners channel on YouTube. More on reddit.com
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
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
Videos
Raspberry Pi GPIO Python Guide
Raspberry Pi Full Course for Beginners | OS Setup, Python ...
10:47
You NEED to Learn Raspberry Pi GPIO Pins (Beginner to Pro) - YouTube
04:35
Raspberry Pi GPIO: A Beginnerโs Guide (2025) - YouTube
10:26
Raspberry Pi GPIO Programming with Python - Part 1: Introduction ...
13:42
Python GPIO - Input Pin Push Button Example & Compatibility With ...
Python Programming
pythonprogramming.net โบ gpio-example-raspberry-pi
Programming GPIO example
First, to use GPIO, you will need to make sure you have the packages necessary on your Raspberry Pi. Via the Pi terminal, type: sudo apt-get install python-rpi.gpio
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 15, 2024 - You can generate the documentation, such as it is, locally with `python3 -m pydoc gpiod` for the text version, or `python3 -m pydoc -p 1234` and pointing your browser at http://localhost:1234/gpiod.html for the html version. ... The AI made me this code for my gpiod v1 and it works.
SourceForge
sourceforge.net โบ home โบ browse โบ raspberry-gpio-python โบ wiki
raspberry-gpio-python / Wiki / BasicUsage
Your script could break between revisions of Raspberry Pi boards. ... It is possible that you have more than one script/circuit on the GPIO of your Raspberry Pi. As a result of this, if RPi.GPIO detects that a pin has been configured to something other than the default (input), you get a warning ...
Phazertech
phazertech.com โบ tutorials โบ rpi-gpio.html
GPIO Python Guide
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.
PyPI
pypi.org โบ project โบ RPi.GPIO
RPi.GPIO ยท PyPI
Download URL: RPi.GPIO-0.7.1-cp27-cp27mu-linux_armv6l.whl ... Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/30.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.2.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.10.2 ยท See more details on using hashes here. ... AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page
ยป pip install RPi.GPIO
Published ย Feb 06, 2022
Version ย 0.7.1
Raspberry Pi
projects.raspberrypi.org โบ en โบ projects โบ physical-computing โบ 1
GPIO pins - Physical Computing with Python
We're sorry, but this site requires JavaScript to operate
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. This Instructable will show you how to install the GPIO package on your Raspberry Pi and hโฆ
Python Programming
pythonprogramming.net โบ gpio-raspberry-pi-tutorials
GPIO (General Purpose Input Output) Pins - Raspberry Pi ...
Now you can turn your Raspberry Pi on, and we'll begin the code. ... You probably already have it, but just to make sure. Next, create a new python file, and let's begin: import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM)
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) ...
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.
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 - There are several GPIO Python libraries available but we recommend you use the one found at http://pypi.python.org/pypi/RPi.GPIO. Although it is possible to download the library through a web browser it's much faster to do the installation process through the terminal on your raspberry pi.
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 - Looking through the docs for RPi.GPIO, I found a method called GPIO.cleanup() and another great blog post with a pretty good error handling pattern that I decided to employ. Error handling is an important part of developing software of all kinds, but has pretty significant implications when a error on the Pi could short out some physical hardware if not handled appropriately. I do want to take just a second and talk about the pattern I used, the try/except/finally block in Python.
Ubuntu
ubuntu.com โบ tutorials โบ gpio-on-raspberry-pi
How to use Raspberry Pi GPIO pins with Ubuntu | Ubuntu
No resistor is needed for the PWM pin, which is GPIO 18 in the example script. The fan model I am using has an open-collector circuit design (as do most fans), so a 1kฮฉ pull-up resistor is needed. NOTE: The pull-up resistor must be connected to one of the 3.3V pins on the Raspberry Pi. If it is connected to a 5V pin, the Pi could be severely damaged. See the wiring diagram below as an example: After connecting the fan and Raspberry Pi, run the following Python ...
SparkFun Learn
learn.sparkfun.com โบ tutorials โบ raspberry-gpio โบ python-rpigpio-api
Python (RPi.GPIO) API - Raspberry gPIo - SparkFun Learn
PWM on the Raspberry Pi is about as limited as can be -- one, single pin is capable of it: 18 (i.e. board pin 12). To initialize PWM, use GPIO.PWM([pin], [frequency]) function. To make the rest of your script-writing easier you can assign that instance to a variable.