hyperion.ng/effects/strobe.py
T. van der Zwan e769117dfd Added some strobes, removed execute flag from json files
Former-commit-id: 0589c5014451b775d61a42d97a90f03f358c7ab3
2013-12-14 02:03:21 +00:00

25 lines
615 B
Python

import hyperion
import time
import colorsys
# Get the rotation time
color = hyperion.args.get('color', (255,255,255))
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 * colo)
# Start the write data loop
while not hyperion.abort():
hyperion.setColor(blackLedsData)
time.sleep(sleepTime)
hyperion.setColor(whiteLedsData)
time.sleep(sleepTime)