def main(): out = ColorsOut() pix = [(0.0, 0.0, 0.0)] * 48 curr = 0 r = (float)(random.randrange(lower, 1024)) g = (float)(random.randrange(lower, 1024)) b = (float)(random.randrange(lower, 1024)) pix[curr] = (r, g, b) curr += 1 out.write(pix) time.sleep(0.2) while True: while curr < 47: r, g, b = colorAdd(r, g, b) pix[curr] = (r, g, b) out.write(pix) time.sleep(0.2) curr += 1 while curr > 0: r, g, b = colorAdd(r, g, b) pix[curr] = (r, g, b) out.write(pix) time.sleep(0.2) curr -= 1
# 1001 # 1111 numbers.append([[1, 1, 1, 1], [1, 0, 0, 1], [1, 1, 1, 1], [1, 0, 0, 1], [1, 1, 1, 1]]) # 1111 # 1001 # 1111 # 0001 # 0001 numbers.append([[1, 1, 1, 1], [1, 0, 0, 1], [1, 1, 1, 1], [0, 0, 0, 1], [0, 0, 0, 1]]) if __name__ == "__main__": import time out = ColorsOut() init() num = 0 while True: pix = [] output = [] if num == len(numbers): num = 0 for i in numbers[num]: output.insert(0, i) output.append([0, 0, 0, 0]) for i in output: for j in i: if j: pix.append((1023.0, 0.0, 0.0)) else:
def __init__(self): threading.Thread.__init__(self) self.out = ColorsOut()