Skip to content

Instantly share code, notes, and snippets.

@fd0
Created December 28, 2009 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 fd0/264756 to your computer and use it in GitHub Desktop.
Save fd0/264756 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
def cmd(*bytes)
while bytes.length < 15
bytes << 0x00
end
data = bytes.collect{ |b| "0x%02x" % b }.join(',')
p data if $VERBOSE
system("usbtool -P fnordlicht-control -d \"%s\" control out vendor device 1 0 0" % data)
end
def resync(addr = 0)
cmd(0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b, addr)
end
resync()
cmd(0xff, 0x08, 0x01)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment