Skip to content

Instantly share code, notes, and snippets.

@sasimpson
Created November 29, 2011 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sasimpson/1405374 to your computer and use it in GitHub Desktop.
Save sasimpson/1405374 to your computer and use it in GitHub Desktop.
python to send proper hex to arduino program
def color_bulb(s, bulb, i, rgb):
req = "2E %02X %s %02X %02X %02X" % (bulb, i, rgb[0], rgb[1], rgb[2])
print req
s.write(binascii.unhexlify(''.join(req.split())))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment