Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import RPi.GPIO as GPIO
- import time
- GPIO.setmode(GPIO.BCM)
- GPIO.setup(17, GPIO.OUT)
- GPIO.setwarnings(False)
- ajoutAngle = 5
- print("ok")
- pwm=GPIO.PWM(17,100)
- pwm.start(5)
- i = 0
- while i < 5:
- angle1 = 80
- duty1 = float(angle1)/10 + ajoutAngle
- angle2=180
- duty2= float(angle2)/10 + ajoutAngle
- pwm.ChangeDutyCycle(duty1)
- time.sleep(1)
- pwm.ChangeDutyCycle(duty2)
- time.sleep(1)
- i= i + 1
- GPIO.cleanup()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement