Example #1
0
def runner(per_strip, strip, my_flies, strip_handle, t):
    # update state of all ffs
    my_flies1 = ffs.update_state(my_flies, t, strip, per_strip)

    # check who blinked
    for i in xrange(strip):
        for j in xrange(per_strip):
            strip_handle[i].setPixelColorRGB(j, my_flies1[i][j].brightnessR, my_flies1[i][j].brightnessG, 0)

    # update strip
    for i in xrange(strip):
        strip_handle[i].show()

    return my_flies1
Example #2
0
def runner(per_strip, strip, my_flies, port, t):
    #update state of all ffs
    my_flies1 = ffs.update_state(my_flies, t, strip, per_strip)

    #fill buffer
    r_val = []
    g_val = []
    for i in xrange(strip):
        for j in xrange(per_strip):
            r_val.append(my_flies1[i][j].brightnessR)
            g_val.append(my_flies1[i][j].brightnessG)
    
    #pass signal
    for i in r_val:
        port.write(chr(i))
    for j in g_val:
        port.write(chr(j))
        
    return my_flies1