| Line 101... |
Line 101... |
| 101 |
txOpcode = "21".decode('hex')
|
101 |
txOpcode = "21".decode('hex')
|
| 102 |
txData = ''.join("%02x%02x%02x%02x" % (len(string), r, g, b))
|
102 |
txData = ''.join("%02x%02x%02x%02x" % (len(string), r, g, b))
|
| 103 |
txString = string.encode('hex')
|
103 |
txString = string.encode('hex')
|
| 104 |
sock.send(txFrame + txOpcode + txData.decode('hex') + txString.decode('hex'))
|
104 |
sock.send(txFrame + txOpcode + txData.decode('hex') + txString.decode('hex'))
|
| 105 |
|
105 |
|
| 106 |
def cube_update_text_insert(character, r, g, b):
|
106 |
def cube_update_text_insert(character, r, g, b, delay):
|
| 107 |
'''Appends a character to the beginning of the text buffer.'''
|
107 |
'''Appends a character to the beginning of the text buffer.'''
|
| 108 |
txFrame = struct.pack("!6s6sH", dst_addr, hw_addr, 5)
|
108 |
txFrame = struct.pack("!6s6sH", dst_addr, hw_addr, 6)
|
| 109 |
txOpcode = "22".decode('hex')
|
109 |
txOpcode = "22".decode('hex')
|
| 110 |
txData = ''.join("%02x%02x%02x%02x" % (r, g, b, character))
|
110 |
txData = ''.join("%02x%02x%02x%02x%02x" % (r, g, b, delay, character))
|
| 111 |
sock.send(txFrame + txOpcode + txData.decode('hex'))
|
111 |
sock.send(txFrame + txOpcode + txData.decode('hex'))
|
| 112 |
|
112 |
|
| 113 |
def cube_update_waterfall(c0, c1, c2, c3, c4, c5, c6, c7):
|
113 |
def cube_update_waterfall(c0, c1, c2, c3, c4, c5, c6, c7):
|
| 114 |
'''Fills in one row and shifts rows by one.'''
|
114 |
'''Fills in one row and shifts rows by one.'''
|
| 115 |
txFrame = struct.pack("!6s6sH", dst_addr, hw_addr, 9)
|
115 |
txFrame = struct.pack("!6s6sH", dst_addr, hw_addr, 9)
|