diff --git a/effects/x-mas.json b/effects/x-mas.json new file mode 100644 index 00000000..72892a52 --- /dev/null +++ b/effects/x-mas.json @@ -0,0 +1,8 @@ +{ + "name" : "X-Mas", + "script" : "x-mas.py", + "args" : + { + "sleepTime" : 0.75 + } +} diff --git a/effects/x-mas.py b/effects/x-mas.py new file mode 100644 index 00000000..697d6f71 --- /dev/null +++ b/effects/x-mas.py @@ -0,0 +1,28 @@ +import hyperion +import time +import colorsys + +# Get the parameters +sleepTime = float(hyperion.args.get('sleepTime', 1.0)) + +# Initialize the led data +ledDataOdd = bytearray() +for i in range(hyperion.ledCount): + if i%2 == 0: + ledDataOdd += bytearray((int(255), int(0), int(0))) + else: + ledDataOdd += bytearray((int(255), int(255), int(255))) + +ledDataEven = bytearray() +for i in range(hyperion.ledCount): + if i%2 == 0: + ledDataEven += bytearray((int(255), int(255), int(255))) + else: + ledDataEven += bytearray((int(255), int(0), int(0))) + +# Start the write data loop +while not hyperion.abort(): + hyperion.setColor(ledDataOdd) + time.sleep(sleepTime) + hyperion.setColor(ledDataEven) + time.sleep(sleepTime) \ No newline at end of file