2016-12-03 21:11:52 +01:00
|
|
|
import hyperion, time, colorsys
|
2015-12-09 16:08:26 +01:00
|
|
|
|
|
|
|
# Get the parameters
|
2015-12-09 16:18:08 +01:00
|
|
|
sleepTime = float(hyperion.args.get('sleepTime', 1.0))
|
2015-12-09 16:08:26 +01:00
|
|
|
|
|
|
|
# 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)
|
2015-12-09 16:18:08 +01:00
|
|
|
time.sleep(sleepTime)
|
2015-12-09 16:08:26 +01:00
|
|
|
hyperion.setColor(ledDataEven)
|
2015-12-09 16:18:08 +01:00
|
|
|
time.sleep(sleepTime)
|