mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
New X-Mas Effect added
Former-commit-id: b5fb724f5b07f1cd55fef620c02f285522680cf6
This commit is contained in:
parent
8a6414b250
commit
d3b3ce7630
@ -3,6 +3,6 @@
|
|||||||
"script" : "x-mas.py",
|
"script" : "x-mas.py",
|
||||||
"args" :
|
"args" :
|
||||||
{
|
{
|
||||||
"frequency" : 50.0
|
"sleepTime" : 0.75
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,13 +3,7 @@ import time
|
|||||||
import colorsys
|
import colorsys
|
||||||
|
|
||||||
# Get the parameters
|
# Get the parameters
|
||||||
frequency = float(hyperion.args.get('frequency', 10.0))
|
sleepTime = float(hyperion.args.get('sleepTime', 1.0))
|
||||||
|
|
||||||
# Check parameters
|
|
||||||
frequency = min(100.0, frequency)
|
|
||||||
|
|
||||||
# Compute the strobe interval
|
|
||||||
sleepTime = 1.0 / frequency
|
|
||||||
|
|
||||||
# Initialize the led data
|
# Initialize the led data
|
||||||
ledDataOdd = bytearray()
|
ledDataOdd = bytearray()
|
||||||
@ -29,6 +23,6 @@ for i in range(hyperion.ledCount):
|
|||||||
# Start the write data loop
|
# Start the write data loop
|
||||||
while not hyperion.abort():
|
while not hyperion.abort():
|
||||||
hyperion.setColor(ledDataOdd)
|
hyperion.setColor(ledDataOdd)
|
||||||
time.sleep(0.75)
|
time.sleep(sleepTime)
|
||||||
hyperion.setColor(ledDataEven)
|
hyperion.setColor(ledDataEven)
|
||||||
time.sleep(0.75)
|
time.sleep(sleepTime)
|
Loading…
x
Reference in New Issue
Block a user