simplify effects

Former-commit-id: bbb8dc4c38
This commit is contained in:
redpanther 2016-01-28 06:12:28 +01:00
parent 8732ffacf4
commit e5b802c01d
2 changed files with 6 additions and 14 deletions

View File

@ -1,4 +1,4 @@
import hyperion, time, colorsys, random, subprocess
import hyperion, time, subprocess
def setPixel(x,y,rgb):
global imageData, width
@ -17,8 +17,6 @@ width = 12
height = 10
imageData = bytearray(height * width * (0,0,0))
imageDataBlack = bytearray(height * width * (0,0,0))
imageDataRed = bytearray(height * width * alarmColor)
# Start the write data loop
for i in range(6):
@ -26,9 +24,9 @@ for i in range(6):
off = False
break
if i % 2:
hyperion.setImage(width, height, imageDataRed)
hyperion.setColor(alarmColor[0], alarmColor[1], alarmColor[2])
else:
hyperion.setImage(width, height, imageDataBlack)
hyperion.setColor(0, 0, 0)
time.sleep(sleepTime)
for y in range(height,0,-1):

View File

@ -1,6 +1,4 @@
import hyperion
import time
import colorsys
import hyperion, time
# Get the rotation time
color = hyperion.args.get('color', (255,255,255))
@ -12,13 +10,9 @@ 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 * color)
# Start the write data loop
while not hyperion.abort():
hyperion.setColor(blackLedsData)
hyperion.setColor(0, 0, 0)
time.sleep(sleepTime)
hyperion.setColor(whiteLedsData)
hyperion.setColor(color[0], color[1], color[2])
time.sleep(sleepTime)