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
Python Programming
pythonprogramming.net › gpio-example-raspberry-pi
Programming GPIO example
Here we are setting the mode to BCM, which is the naming convention for the GPIO pins. You can either address the pins by their actual physical pin number, or their "name" assigned to them.
Videos
13:42
Python GPIO - Input Pin Push Button Example & Compatibility With ...
Raspberry Pi GPIO Python Guide
10:26
Raspberry Pi GPIO Programming with Python - Part 1: Introduction ...
19:15
Raspberry Pi - Control GPIO Pins with GPIOzero Library - YouTube
48:40
Raspberry Pi GPIO - Getting Started with gpiozero - YouTube
15:38
Raspberry Pi Robotics #1: GPIO Control - YouTube
PyPI
pypi.org › project › RPi.GPIO
RPi.GPIO · PyPI
» pip install RPi.GPIO
Readthedocs
python-periphery.readthedocs.io › en › latest › gpio.html
GPIO — python-periphery 2.4.1 documentation
from periphery import GPIO # Open GPIO /dev/gpiochip0 line 10 with input direction gpio_in = GPIO("/dev/gpiochip0", 10, "in") # Open GPIO /dev/gpiochip0 line 12 with output direction gpio_out = GPIO("/dev/gpiochip0", 12, "out") value = gpio_in.read() gpio_out.write(not value) gpio_in.close() ...
SparkFun Learn
learn.sparkfun.com › tutorials › raspberry-gpio › python-rpigpio-api
Python (RPi.GPIO) API - Raspberry gPIo - SparkFun Learn
Now then. Lets incorporate everything we learned here into an example script to try everything out. ... Pages Introduction GPIO Pinout Hardware Setup Python (RPi.GPIO) API Python (RPi.GPIO) Example C (WiringPi) Setup C (WiringPi) API C (WiringPi) Example Using an IDE!
SourceForge
sourceforge.net › home › browse › raspberry-gpio-python › wiki
raspberry-gpio-python / Wiki / Examples
Wiki: BasicUsage Wiki: Checking function of GPIO channels Wiki: Home Wiki: Inputs Wiki: Outputs Wiki: PWM
SourceForge
sourceforge.net › home › browse › raspberry-gpio-python › wiki
raspberry-gpio-python / Wiki / BasicUsage
GPIO.setmode(GPIO.BOARD) # or GPIO.setmode(GPIO.BCM) To detect which pin numbering system has been set (for example, by another Python module): mode = GPIO.getmode() The mode will be GPIO.BOARD, GPIO.BCM or None · It is possible that you have more than one script/circuit on the GPIO of your Raspberry Pi.
Phazertech
phazertech.com › tutorials › rpi-gpio.html
GPIO Python Guide
July 6, 2024 - For example, you could use a 10K resistor for R2 and a 6.8K resistor for R1, just like I did in the push button example. Now copy and paste the following code into a new Python file and run it: from gpiozero import DistanceSensor import time ultrasonic = DistanceSensor(echo=17, trigger=4) while ...
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…
Egb320
egb320.github.io › WebsiteFiles › GPIOpython.html
Raspberry Pi GPIO and Python Tutorial
import RPi.GPIO as GPIO # Import ... can run the script by running the following command within the terminal: ... This example demonstrates how to perform software PWM to flash an LED....
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.
SparkFun Learn
learn.sparkfun.com › tutorials › raspberry-gpio › all
Raspberry gPIo - SparkFun Learn
RPi.GPIO API -- An overview of the Python functions you can use to drive GPIO. RPi.GPIO Example -- An example Python script that shows off both input and output functionality.
Cmac-duke
cmac-duke.github.io › physical-computing › tutorials › pi-gpio
Raspberry Pi Zero and GPIO
We can interact with the pin we defined above with ‘GPIO.output’. Here we’re referencing the pin, and setting the output of the pin to high, much like we would with the Particle Photons. This will output 3.3v to pin 23 ... We can start to set up our program much like we would with the Photons, with a “setup” function and a “loop” function. Since there is no set syntax for python and no “special functions”, we could call these functions anything we want, but for now we’ll stick with “setup” and “loop”
GeeksforGeeks
geeksforgeeks.org › python › introduction-to-python-raspberry-pi-rpigpio-library
Introduction to Python Raspberry Pi (RPiGPIO) Library - GeeksforGeeks
July 23, 2025 - One of the key features that make the Raspberry Pi so popular is its General Purpose Input/Output (GPIO) pins. These pins allow us to interact with the outside world by connecting sensors, LEDs, motors, and other hardware components. To control these GPIO pins using Python, the RPi.GPIO module ...
gpiozero
gpiozero.readthedocs.io › en › stable › recipes.html
2. Basic Recipes — gpiozero 2.0.1 Documentation
If you prefer a version that works under IDLE, the following recipe should suffice: from gpiozero import Robot, Motor from evdev import InputDevice, list_devices, ecodes robot = Robot(left=Motor(4, 14), right=Motor(17, 18)) # Get the list of available input devices devices = [InputDevice(device) ...
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