Created
January 10, 2020 02:40
-
-
Save Bill-Park/21ddd6052ff3bc109d044d117950692b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import RPi.GPIO as GPIO | |
from time import sleep | |
GPIO.setmode(GPIO.BCM) | |
servoPin = 18 | |
GPIO.setup(servoPin, GPIO.OUT) | |
p = GPIO.PWM(servoPin, 50) # set to 50Hz | |
p.start(0) | |
p.ChangeDutyCycle(3) | |
sleep(1) | |
p.ChangeDutyCycle(7.5) | |
sleep(1) | |
p.ChangeDutyCycle(12) | |
sleep(1) | |
p.stop() | |
GPIO.cleanup() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment