Skip to content

Instantly share code, notes, and snippets.

johnwargo /
Last active Nov 19, 2020
Simple Python app for controlling a relay through an GPIO Zero Output device
# A simple Python application for controlling a relay board from a Raspberry Pi
# The application uses the GPIO Zero library (
# The relay is connected to one of the Pi's GPIO ports, then is defined as an Output device
# in GPIO Zero:
import sys
import time