GPIO Zero

2.0.1 · active · verified Thu Apr 16

GPIO Zero is a Python library that provides a simple and approachable interface to GPIO (General Purpose Input/Output) devices on Raspberry Pi. It abstracts away low-level pin details, offering high-level classes for common components like LEDs, buttons, motors, and sensors, making physical computing accessible. The current version is 2.0.1. It generally follows a release cadence tied to bug fixes and new features, with major versions introducing breaking changes.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart code demonstrates how to make an LED connected to GPIO pin 17 blink. The `pause()` function keeps the script running indefinitely, allowing the LED to continue blinking.

from gpiozero import LED
from signal import pause

# Replace 17 with your actual GPIO pin number (BCM numbering)
led = LED(17)

led.blink()
pause()

view raw JSON →