Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from MotorBridgeI import MotorBridgeCape
- from time import sleep
- motor = MotorBridgeCape()
- motor.ServoInit(1, 50)
- angle1 = 10
- angle2 = 170
- # Y = 0
- def inlineOne():
- angle = int(input("Give me a number b/t 0 and 180"))
- if angle <= 180:
- sleep(0.4)
- motor.ServoMoveAngle(1, angle1)
- print("Your Angle is %d" % angle)
- def inlineTwo():
- angle = int(input("Give me another number b/t 0 and 180"))
- if angle >= 0:
- sleep(0.4)
- motor.ServoMoveAngle(1, angle2)
- print("Your Angle is %d" % angle)
- inlineOne()
- inlineTwo()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement