Skip to content

Instantly share code, notes, and snippets.

@alex-dow
alex-dow / sweep.py
Created May 15, 2018 03:35
Sweeping a servo on a raspberry pi
import time
import pigpio
# GPIO number. On a rapsberry pi 1, the hardware PWM pin is
# GPIO 18
SERVO_PIN = 18
# Delay in seconds to wait after sending an angle to the servo
# motor
DELAY = 0.02