modify effects

- snake has a nice tail
- random is not so fast anymore
- merge sparks and sparks-color
- make more params available in json files


Former-commit-id: fc2a4f6f6ce2b44a35a75a9c0dbe36504b790be9
This commit is contained in:
redpanther
2016-01-20 22:36:21 +01:00
parent 7dfe8ae8cf
commit de5b284975
8 changed files with 50 additions and 69 deletions

View File

@@ -1,24 +1,20 @@
import hyperion
import time
import colorsys
import random
import hyperion, time, colorsys, random
# get args
sleepTime = float(hyperion.args.get('speed', 1.0))
saturation = float(hyperion.args.get('saturation', 1.0))
ledData = bytearray()
# Initialize the led data
ledData = bytearray()
for i in range(hyperion.ledCount):
ledData += bytearray((0,0,0))
sleepTime = 0.001
# Start the write data loop
while not hyperion.abort():
hyperion.setColor(ledData)
for i in range(hyperion.ledCount):
if random.randrange(10) == 1:
hue = random.random()
sat = 1.0
val = random.random()
rgb = colorsys.hsv_to_rgb(hue, sat, val)
rgb = colorsys.hsv_to_rgb(random.random(), saturation, random.random())
ledData[i*3 ] = int(255*rgb[0])
ledData[i*3+1] = int(255*rgb[1])
ledData[i*3+2] = int(255*rgb[2])