Skip to content

Instantly share code, notes, and snippets.

@chdsbd
Last active August 31, 2016 04:35
Show Gist options
  • Save chdsbd/692f9fc39b0f58ff27f35e775dfed7fb to your computer and use it in GitHub Desktop.
Save chdsbd/692f9fc39b0f58ff27f35e775dfed7fb to your computer and use it in GitHub Desktop.
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(13, GPIO.OUT)
p = GPIO.PWM(13, 50)
p.start(7)
print "STARTED"
for i in range(0, 11):
print "PWM duty cycle of: ", i
p.ChangeDutyCycle(i)
nextdc = i + 1
raw_input("Hit return to go to next DC of {}".format(nextdc))
p.stop()
GPIO.cleanup()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment