Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. import MotorBridge
  2. import time
  3.  
  4. MotorName        = 1
  5. MotorName        = 4
  6. ClockWise        = 1
  7. CounterClockWise = 2
  8. PwmDuty          = 90
  9. Frequency        = 1000
  10.  
  11. if __name__=="__main__":
  12.     motor = MotorBridge.MotorBridgeCape()
  13.     motor.DCMotorInit(1,1000)
  14.     motor.DCMotorInit(4, 1000)
  15.     while True:
  16.         motor.DCMotorMove(1,1,90)
  17.         time.sleep(2)
  18.         motor.DCMotorMove(4,1,90)
  19.         time.sleep(2)
  20.         motor.DCMotorMove(1,2,90)
  21.         time.sleep(2)
  22.         motor.DCMotorMove(4,2,90)
  23.         time.sleep(2)
  24.         print "hello"
  25.         motor.DCMotorStop(1)
  26.         time.sleep(2)
  27.         motor.DCMotorStop(4)
  28.         time.sleep(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement