Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- # Looking around some?
- import MotorBridge
- from time import sleep
- ab = 0.0
- ac = 0.0
- ad = 0.0
- ae = 0.0
- af = 0.0
- ag = 0.0
- motor = MotorBridge.MotorBridgeCape()
- motor.StepperMotorAInit()
- class board:
- def StepperMotorATest():
- ab = 55
- ac = 45
- ad = 35
- ae = 25
- af = 85
- ag = 75
- core = int(input("Please provide a numerical value between 0 and 100\n "))
- if ab >= 86:
- motor.StepperMotorAMove(2500, 1000)
- sleep(5)
- motor.StepperMotorAMove(-2500, 1000)
- elif ag == 76:
- motor.StepperMotorAMove(1000, 1000)
- motor.StepperMotorAMove(-1000, 1000)
- elif af <= 25:
- motor.StepperMotorAMove(0, 0)
- sleep(5)
- elif ac == 50:
- motor.StepperMotorAMove(750, 1000)
- sleep(5)
- motor.StepperMotorAMove(-750, 1000)
- elif ad <= 24 / 2:
- motor.StepperMotorAMove(3600, 1500)
- sleep(5)
- motor.StepperMotorAMove(-3600, 1500)
- else:
- motor.StepperMotorAMove(500, 800)
- sleep(5)
- motor.StepperMotorAMove(-500, 800)
- print("Starting the Script, try to press Control-C to quit!\n")
- try:
- while True:
- board.StepperMotorATest()
- sleep(5)
- except KeyboardInterrupt:
- print("You may have just pressed Control-C!\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement