I've created a couple of flag effects for Euro 2016:
Portugal Code:
import hyperion
import time
import colorsys
# Initialize the led data
leds = bytearray()
# Do Portugal, width = 10
# green
for i in range(3):
leds += bytearray((int(0), int(102), int(0)))
# yellow
for i in range(2):
leds += bytearray((int(255), int(255), int(0)))
# red
for i in range(5):
leds += bytearray((int(255), int(0), int(0)))
while not hyperion.abort():
hyperion.setImage(10,1,leds)
time.sleep(5.0)
Alles anzeigen
France Code:
import hyperion
import time
import colorsys
# Initialize the led data
leds = bytearray()
# Do France, width = 9
# blue
leds += bytearray((int(0), int(85), int(164)))
leds += bytearray((int(0), int(85), int(164)))
leds += bytearray((int(0), int(85), int(164)))
# white
leds += bytearray((int(255), int(255), int(255)))
leds += bytearray((int(255), int(255), int(255)))
leds += bytearray((int(255), int(255), int(255)))
# red
leds += bytearray((int(239), int(65), int(53)))
leds += bytearray((int(239), int(65), int(53)))
leds += bytearray((int(239), int(65), int(53)))
while not hyperion.abort():
hyperion.setImage(9,1,leds)
time.sleep(5.0)
Alles anzeigen
Feel free to make the matches more enjoyable.