silver2row

Trying w/ Servos

May 4th, 2020
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. # from smbus2 import SMBus
  2. from ServoLibII import *  # https://pastebin.com/RhKjeKC1
  3. from time import sleep
  4.  
  5. i2c_bus = SMBus("/dev/i2c-2")
  6. x = PCA9685(i2c_bus, 0b10000000)
  7.  
  8. if x == 45 or x == 180:
  9.     angle = int(input("Please provide your angle in a numerical value: "))
  10.     if x <= 180 and x >= 0:
  11.         angle = i
  12.     print("Your Angle Number is: %d" % i)
Add Comment
Please, Sign In to add comment