Skip to content

Instantly share code, notes, and snippets.

@buhii
Created August 19, 2012 09:06
Show Gist options
  • Save buhii/3393871 to your computer and use it in GitHub Desktop.
Save buhii/3393871 to your computer and use it in GitHub Desktop.
in progress
# -*- coding: utf-8 -*-
from struct import pack
class RCB_4HV(object):
def __init__(self):
pass
def uni_servo(self, ics, speed, position):
# uni servo control
ret = '\x07' # size
ret += '\x0f' # command
ret += chr(ics)
ret += chr(speed)
ret += pack('<h', position)
checksum = chr(sum(map(ord, ret)) % 256)
ret += checksum
return ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment