test
This commit is contained in:
@@ -1,21 +1,7 @@
|
|||||||
import time
|
import time
|
||||||
from dw640HAT import dw_MotorCONTROL, dw_DCMotor
|
from dw640HAT import dw_MotorCONTROL, dw_DCMotor
|
||||||
|
|
||||||
dw = dw_MotorCONTROL( addr=0x60 )
|
dw = dw_PWMCONTROL( addr=0x61 )
|
||||||
m = dw.getMotor(1)
|
m = dw.getMotor(2)
|
||||||
|
|
||||||
m.run(dw_MotorCONTROL.RELEASE)
|
m.off();
|
||||||
time.sleep(5)
|
|
||||||
|
|
||||||
##time.sleep(10)
|
|
||||||
print "Set forward"
|
|
||||||
m.setMotorSpeed(255)
|
|
||||||
time.sleep(5)
|
|
||||||
print "stop"
|
|
||||||
m.setMotorSpeed(0)
|
|
||||||
time.sleep(5)
|
|
||||||
print "Set reverse"
|
|
||||||
m.setMotorSpeed(-255)
|
|
||||||
time.sleep(5)
|
|
||||||
print "stop"
|
|
||||||
m.run(dw_MotorCONTROL.RELEASE)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user