def scan(): strip = Strip(150) while True: strip.artnet.addr = [("192.168.89.255", 6454)] devices = strip.artnet.poll() print(devices) for i, device in enumerate(devices): strip.artnet.addr = [device] strip.clear(color[i]) strip.send() print("-> ", device, color[i], colornames[i]) time.sleep(.1) time.sleep(10)
def testFade(count): print( "*** testFade ***" ) strip = Strip(150) while count > 0: strip.clear([255, 0, 255]) strip.send() for _i in range(10): time.sleep(1) strip.fade(0.6) strip.send() count -= 1 strip.artnet.close()
return 255 if count < period26: count -= period16 return 255 * (period16 - count) / period16 if count < period46: return 0 if count < period56: count -= period46 return 255 * count / period16 if count < period: return 255 return 0 def rainbow(count): r = getColorValue2(count) g = getColorValue2(count - period13) b = getColorValue2(count - period23) return [r, g, b] count = 0 strip = Strip(150) strip.clear() strip.send() while True: strip.clear(rainbow(count)) strip.send() count += 1 if count >= period: count -= period time.sleep(.1)