hyperion.ng/effects/strobe.py
T. van der Zwan 9d26238d49 Updated the deploy with the new index option (and strobe effect)
Former-commit-id: 93335ab096599c355686b1644d5e5a34f37f567e
2013-12-13 22:00:57 +00:00

24 lines
560 B
Python

import hyperion
import time
import colorsys
# Get the rotation time
frequency = float(hyperion.args.get('frequency', 10.0))
# Check parameters
frequency = min(100.0, frequency)
# Compute the strobe interval
sleepTime = 1.0 / frequency
# Initialize the led data
blackLedsData = bytearray(hyperion.ledCount * ( 0, 0, 0))
whiteLedsData = bytearray(hyperion.ledCount * (255,255,255))
# Start the write data loop
while not hyperion.abort():
hyperion.setColor(blackLedsData)
time.sleep(sleepTime)
hyperion.setColor(whiteLedsData)
time.sleep(sleepTime)