Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pybot/drivers/shld_cc.py
diff options
context:
space:
mode:
Diffstat (limited to 'pybot/drivers/shld_cc.py')
-rw-r--r--pybot/drivers/shld_cc.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/pybot/drivers/shld_cc.py b/pybot/drivers/shld_cc.py
new file mode 100644
index 0000000..35b94ae
--- /dev/null
+++ b/pybot/drivers/shld_cc.py
@@ -0,0 +1,15 @@
+
+RD_VERSION = 0x00
+SET_VEL_2MTR = 0x01
+
+def getVersion(dev):
+ dev.send([RD_VERSION])
+ raw = dev.read(3)
+ return raw[1] + raw[2] * 256
+
+def setvel2mtr(dev, sentido1, vel1, sentido2, vel2):
+ msg = [SET_VEL_2MTR, sentido1, vel1 / 256, vel1 % 256, sentido2, vel2 / 256, vel2 % 256]
+ dev.send(msg)
+ raw = dev.read(1)
+ return raw[0]
+