Advertisement
silver2row

Just some Motor Bridge Cape stuff

Feb 8th, 2020
476
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. from MotorBridgeI import MotorBridgeCape
  2. from time import sleep
  3.  
  4. motor = MotorBridgeCape()
  5. motor.ServoInit(1, 50)
  6.  
  7. angle1 = 10
  8. angle2 = 170
  9. # Y = 0
  10.  
  11. def inlineOne():
  12.     angle = int(input("Give me a number b/t 0 and 180"))
  13.     if angle <= 180:
  14.         sleep(0.4)
  15.         motor.ServoMoveAngle(1, angle1)
  16.     print("Your Angle is %d" % angle)
  17.  
  18. def inlineTwo():
  19.     angle = int(input("Give me another number b/t 0 and 180"))
  20.     if angle >= 0:
  21.         sleep(0.4)
  22.         motor.ServoMoveAngle(1, angle2)
  23.     print("Your Angle is %d" % angle)
  24.  
  25. inlineOne()
  26. inlineTwo()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement