Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- from PCA96xx import *
- from time import sleep
- i2c_bus = SMBus("/dev/i2c-2")
- pwm_controller = PCA9685(i2c_bus, 0x34)
- def servo():
- angle = int(input("Please enter a value from 0 to 90: "))
- if pwm_controller >= 1 and pwm_controller >= 90:
- angle = pwm_controller
- print ("Your Angle is: %d" % pwm_controller)
- servo()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement