Subversion Repositories Code-Repo

Rev

Rev 268 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 268 Rev 290
Line 84... Line 84...
84
    for c in range(3):
84
    for c in range(3):
85
        txColorCh = "%02x" % c
85
        txColorCh = "%02x" % c
86
        txData = ''.join( ["%02x" % (x) for x in frame_buffer[c::3]])
86
        txData = ''.join( ["%02x" % (x) for x in frame_buffer[c::3]])
87
        payload = txFrame + txOpcode + txColorCh.decode('hex') + txData.decode('hex')
87
        payload = txFrame + txOpcode + txColorCh.decode('hex') + txData.decode('hex')
88
        sock.send(payload)
88
        sock.send(payload)
-
 
89
        time.sleep(0.01)    # This value can be smaller (and should be) to reduce flickering
89
 
90
 
90
def cube_update_text_scrolling(string, r, g, b, update_rate):
91
def cube_update_text_scrolling(string, r, g, b, update_rate):
91
    '''Sets the scrolling text on the cube.'''
92
    '''Sets the scrolling text on the cube.'''
92
    txFrame = struct.pack("!6s6sH", dst_addr, hw_addr, len(string) + 6)
93
    txFrame = struct.pack("!6s6sH", dst_addr, hw_addr, len(string) + 6)
93
    txOpcode = "20".decode('hex')
94
    txOpcode = "20".decode('hex')