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(2, 50)
- motor.ServoInit(6, 50)
- mylist = [0]
- def servo(moveOne):
- for angle in 0, 45, 90, 135, 180, 135, 90, 45, 0:
- sleep(0.4)
- motor.ServoMoveAngle(2, angle)
- motor.ServoMoveAngle(6, angle)
- def inlineOne(MoveItOne):
- for angle in 10, 20, 30, 40, 50, 60, 70, 80, 990, 100, 110, 120, 130, 140, 150, 160, 170, 180:
- sleep(0.4)
- motor.ServoMoveAngle(2, angle)
- motor.ServoMoveAngle(6, angle)
- def inlineTwo(MoveItTwo):
- for angle in 180, 150, 120, 90, 60, 30, 0:
- sleep(0.4)
- motor.ServoMoveAngle(2, angle)
- motor.ServoMoveAngle(6, angle)
- def inlineServo():
- if mylist == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]:
- sleep(0.4)
- motor.ServoMoveAngle(2, mylist)
- motor.ServoMoveAngle(6, mylist)
- print("The servos are going to move from degree 1 to 10: ", mylist)
- else:
- sleep(0.4)
- print("You are busted!", mylist)
- return
- inlineServo()
- mylist = [10, 20, 30, 40, 50, 60, 70, 80]
- print("Outside of the function values are: ", mylist)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement