Initial test code

This commit is contained in:
shrkey
2016-03-31 22:45:45 +01:00
parent abd90e2cb8
commit 8fa5ea88f3
5 changed files with 377 additions and 0 deletions

21
examples/escapetest.py Normal file
View File

@@ -0,0 +1,21 @@
import time
from dw640HAT import dw_MotorCONTROL, dw_DCMotor
dw = dw_MotorCONTROL( addr=0x60 )
m = dw.getMotor(1)
m.run(dw_MotorCONTROL.RELEASE)
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)