collab/pb-hal

git clone https://git.julia.blue/collab/pb-hal

Rahul ButaniMiscf140848

imu
469 B32 linesraw
1import time
2import motor
3import RPIO
4from RPIO import PWM
5
6RPIO.setwarnings(False)
7
8# non blocking interrupt enable
9#  RPIO.wait_for_interrupts(threaded=True)
10
11
12PWM.setup()
13testMotor = motor.Motor(17, 27, 22, 23, 24)
14
15speed = 0.6
16dur = 2
17
18#  while True:
19    #  pass
20
21print(testMotor)
22testMotor.set(speed)
23time.sleep(dur)
24testMotor.set(0)
25print(testMotor)
26testMotor.set(-speed)
27time.sleep(dur)
28testMotor.set(0)
29print(testMotor)
30import time
31while True:
32    time.sleep(1)