import sys sys.path.append("./osc") from osc import ColorsOut if __name__ == "__main__": import time out = ColorsOut() hue = 0.0 while True: pix = [] c = 1.0 x = c * (1.0 - abs(hue % 2.0 - 1.0)) if hue > 6.0: hue = 0.0 if hue < 1.0: pix = [(1023.0 * c,1023.0 * x,0.0)]*24 elif hue < 2.0: pix = [(1023.0 * x,1023.0 * c,0.0)]*24 elif hue < 3.0: pix = [(0.0,1023.0 * c,1023.0 * x)]*24 elif hue < 4.0: pix = [(0.0,1023.0 * x,1023.0 * c)]*24 elif hue < 5.0: pix = [(1023.0 * x,0.0,1023.0 * c)]*24 elif hue < 6.0: pix = [(1023.0 * c,0.0,1023.0 * x)]*24 out.write(pix) hue += 0.05 time.sleep(0.2)
import sys sys.path.append("./osc") from osc import ColorsOut def printHelp(): print """debugLights.py [debug type] [animation time] [other] debug type: sweep, pattern, solid animation time: time in ms between frames other: for solid, the color to be displayed. RGB, 0-1023 """ if __name__ == "__main__": import time out = ColorsOut() if len(sys.argv) < 2: printHelp() elif sys.argv[1] == "sweep": while True: for i in range(24): pix = [(0.0, 0.0, 0.0)] * 24 if i % 8 == 0: pix[i] = (1023, 0, 0) else: pix[i] = (0, 1023, 1023) out.write(pix) #time.sleep(1.0) time.sleep(float(sys.argv[2]))
from osc import ColorsOut out = ColorsOut() pixels = [(300,500,100)]*24 out.write(pixels)