Created
December 28, 2009 16:15
-
-
Save fd0/264756 to your computer and use it in GitHub Desktop.
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
#!/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