PyPI
pypi.org › project › RPi.GPIO
RPi.GPIO · PyPI
Note that the current release does ... on the RPi yet. This is planned for the near future - watch this space! One-wire functionality is also planned. Although hardware PWM is not available yet, software PWM is available to use on all channels. For examples and documentation, visit http://sourceforge.net/p/raspberry-gpio-python/w...
» pip install RPi.GPIO
SparkFun Learn
learn.sparkfun.com › tutorials › raspberry-gpio › all
Raspberry gPIo - SparkFun Learn
Here's an example sketch that incorporates everything we learned on the last page. It does a little input and output, and even handles some PWM. This assumes you've set up the circuit as arranged on the Hardware Setup page. 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
Videos
08:57
Raspberry Pi GPIO Tutorial: The Basics Explained - YouTube
Raspberry Pi GPIO Python Guide
04:35
Raspberry Pi GPIO: A Beginner’s Guide (2025) - YouTube
04:09
How GPIOs Work - Raspberry Pi 5 Tutorial (#6) - YouTube
10:26
Raspberry Pi GPIO Programming with Python - Part 1: Introduction ...
19:15
Raspberry Pi - Control GPIO Pins with GPIOzero Library - YouTube
SparkFun Learn
learn.sparkfun.com › tutorials › raspberry-gpio › python-rpigpio-example
Python (RPi.GPIO) Example - Raspberry gPIo - SparkFun Learn
Here's an example sketch that incorporates everything we learned on the last page. It does a little input and output, and even handles some PWM. This assumes you've set up the circuit as arranged on the Hardware Setup page. 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
SparkFun Learn
learn.sparkfun.com › tutorials › raspberry-gpio › python-rpigpio-api
Python (RPi.GPIO) API - Raspberry gPIo - SparkFun Learn
There's an optional third parameter ... you need a pull-down resistor, instead use pull_up_down=GPIO.PUD_DOWN. For example, to use a pull-up resistor on GPIO 17, write this into your setup:...
SourceForge
sourceforge.net › home › browse › raspberry-gpio-python › wiki
raspberry-gpio-python / Wiki / BasicUsage
By doing it this way, you can refer to it as just GPIO through the rest of your script. To import the module and check to see if it is successful: try: import RPi.GPIO as GPIO except RuntimeError: print("Error importing RPi.GPIO! This is probably because you need superuser privileges.
Phazertech
phazertech.com › tutorials › rpi-gpio.html
GPIO Python Guide
July 6, 2024 - Next you'll need to give your user permission to access the GPIO regardless of which library you installed. ... Now reboot before continuing. ... This simple program will toggle an output pin on and off. Create a new file and name it test.py: ... import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.setup(8, GPIO.OUT, initial=GPIO.LOW) while True: GPIO.output(8, GPIO.HIGH) time.sleep(1) GPIO.output(8, GPIO.LOW) time.sleep(1)
Electropeak
electropeak.com › learn › tutorial-raspberry-pi-gpio-programming-using-python-full-guide
Raspberry Pi GPIO Pins Programming Using Python [Full Guide]
March 3, 2024 - The steps for creating a Python ... example: Access the Python editor by navigating to the Application Menu and selecting the “Programming” option to initiate the Thonny Python IDE on the Raspberry Pi desktop. To initiate the use of GPIO pins, it is necessary to import the GPIO library using the code: ... This library, which comes pre-installed on the Raspberry Pi system, facilitates GPIO pin control. By using this command, we are just importing this RPi.GPIO module ...
RasPi.TV
raspi.tv › 2013 › rpi-gpio-basics-5-setting-up-and-using-outputs-with-rpi-gpio
RPi.GPIO basics 5 – Setting up and using outputs with RPi.GPIO
June 22, 2015 - Let’s modify the LED script to read the status of GPIO24 (lines 10-11 & 14-15) and give us a message about the LED’s status. (This is a very simple and controlled example. You wouldn’t normally use it in this situation – I’m just showing you how.) import RPi.GPIO as GPIO # import RPi.GPIO module from time import sleep # lets us have a delay GPIO.setmode(GPIO.BCM) # choose BCM or BOARD GPIO.setup(24, GPIO.OUT) # set GPIO24 as an output try: while True: GPIO.output(24, 1) # set GPIO24 to 1/GPIO.HIGH/True sleep(0.5) # wait half a second if GPIO.input(24): print "LED just about to switch off" GPIO.output(24, 0) # set GPIO24 to 0/GPIO.LOW/False sleep(0.5) # wait half a second if not GPIO.input(24): print "LED just about to switch on" except KeyboardInterrupt: # trap a CTRL+C keyboard interrupt GPIO.cleanup() # resets all GPIO ports used by this program
pytz
pythonhosted.org › RPIO
Welcome to RPIO’s documentation! — RPIO 0.10.0 documentation
rpio – command-line tools for inspecting and manipulating GPIOs system-wide. ... $ curl -L https://github.com/metachris/RPIO/archive/master.tar.gz | tar -xz $ cd RPIO-master $ sudo python setup.py install · Debian packages are available at metachris.github.com/rpio/download. After the installation you can use import RPIO as well as the command-line tool rpio. You can find lots of examples inside the documentation, as well as in the /examples/ source directory.
gpiozero
gpiozero.readthedocs.io › en › stable › migrating_from_rpigpio.html
11. Migrating from RPi.GPIO — gpiozero 2.0.1 Documentation
GPIO Zero provides many device classes, each with specific methods and properties bespoke to that device. For example, the functionality for an HC-SR04 Distance Sensor can be found in the DistanceSensor class. As well as specific device classes, we provide base classes InputDevice and OutputDevice.
Readthedocs
rpi-lgpio.readthedocs.io › _ › downloads › en › latest › pdf pdf
rpi-lgpio 0.6 Documentation Release 0.6 Dave Jones May 11, 2024
May 11, 2024 - A workaround for use on old-style boards is to use RPI_LGPIO_REVISION to fake the revision code. For example, 0004 (an old-style model B rev 2) can also be represented by 800012 in the new-style. ... Type "help", "copyright", "credits" or "license" for more information.
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
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › python
RPi.GPIO API documentation? - Raspberry Pi Forums
Info found from terminal like this: pi@raspberrypi:/ $ find -name RPi* 2>/dev/null ./usr/lib/python2.7/dist-packages/RPi ./usr/lib/python2.7/dist-packages/RPi.GPIO-0.7.0.egg-info ./usr/lib/python3/dist-packages/RPi ./usr/lib/python3/dist-packages/RPi.GPIO-0.7.0.egg-info $ head /usr/lib/python3/dist-packages/RPi.GPIO-0.7.0.egg-info Metadata-Version: 1.1 Name: RPi.GPIO Version: 0.7.0 Summary: A module to control Raspberry Pi GPIO channels Home-page: http://sourceforge.net/projects/raspberry-gpio-python/ Author: Ben Croston Author-email: ben@croston.org License: MIT Description: This package provides a class to control the GPIO on a Raspberry Pi. ... For examples and documentation, visit http://sourceforge.net/p/raspberry-gpio ...
Pinout.xyz
pinout.xyz
Raspberry Pi GPIO Pinout
GPIO - General Purpose Input/Output, aka "BCM" or "Broadcom". These are the big numbers, e.g. "GPIO 22". You'll use these with RPi.GPIO and GPIO Zero.
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…
Tieske
tieske.github.io › rpi-gpio › modules › GPIO.html
Raspberry Pi GPIO module
local gpio = require("rpi-gpio") local gpio.setmode(gpio.BOARD) local Pin, Hz, Duty = 11, 100, 50 -- Pin 11, 100Hz, 50% dutycycle gpio.setup_channel(Pin, gpio.OUT, gpio.HIGH) local pwm = gpio.newPWM(Pin, Hz):start(Duty)
Readthedocs
rpi-lgpio.readthedocs.io › en › release-0.4 › differences.html
Differences — rpi-lgpio 0.4 Documentation
For example: $ RPI_LGPIO_REVISION='c03114' python3 Python 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from RPi import GPIO >>> GPIO.RPI_INFO {'P1_REVISION': 3, 'REVISION': 'c03114', 'TYPE': 'Pi 4 Model B', 'MANUFACTURER': 'Sony UK', 'PROCESSOR': 'BCM2711', 'RAM': '4GB'} >>> exit() $ RPI_LGPIO_REVISION='902120' python3 Python 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.