Updated the deploy with the new index option (and strobe effect)

Former-commit-id: 93335ab096599c355686b1644d5e5a34f37f567e
This commit is contained in:
T. van der Zwan
2013-12-13 22:00:57 +00:00
parent f8fdcb0c10
commit 9d26238d49
5 changed files with 38 additions and 5 deletions

8
effects/strobe.json Normal file
View File

@@ -0,0 +1,8 @@
{
"name" : "Stroboscope",
"script" : "strobe.py",
"args" :
{
"frequency" : 10.0
}
}

23
effects/strobe.py Normal file
View File

@@ -0,0 +1,23 @@
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)