Created
August 19, 2012 09:06
-
-
Save buhii/3393871 to your computer and use it in GitHub Desktop.
in progress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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