Created
March 9, 2017 14:18
-
-
Save bphermansson/6879b71619456cd4dd2668e20fb1f0ce to your computer and use it in GitHub Desktop.
Python script for testing Raspberry Pi:s hardware PWM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import pigpio | |
from time import sleep | |
pi = pigpio.pi() | |
# Output is Broadcom Gpio12 (physical pin 32) | |
pi.hardware_PWM(12, 2000, 250000) # 2000Hz 75% dutycycle | |
sleep(1) | |
pi.hardware_PWM(12, 2000, 500000) | |
sleep(1) | |
pi.hardware_PWM(12, 2000, 750000) | |
sleep(1) | |
pi.hardware_PWM(12, 2000, 1000000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment