|
|
@ -3,6 +3,16 @@ from blinkstick import blinkstick
|
|
|
|
from random import randint, choice
|
|
|
|
from random import randint, choice
|
|
|
|
from time import sleep
|
|
|
|
from time import sleep
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def random_grb():
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
Get a random GRB array.
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
# get a random initial color
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
randint(1, 255),
|
|
|
|
|
|
|
|
randint(1, 255),
|
|
|
|
|
|
|
|
randint(1, 255)
|
|
|
|
|
|
|
|
]
|
|
|
|
def set_all_leds(device, grb=[0,0,0]):
|
|
|
|
def set_all_leds(device, grb=[0,0,0]):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Takes a GRB color array as input and sets the color on all LEDs.
|
|
|
|
Takes a GRB color array as input and sets the color on all LEDs.
|
|
|
@ -49,11 +59,7 @@ def morph_grb(grb, steps, mode='single'):
|
|
|
|
device = blinkstick.find_first()
|
|
|
|
device = blinkstick.find_first()
|
|
|
|
|
|
|
|
|
|
|
|
# get a random initial color
|
|
|
|
# get a random initial color
|
|
|
|
grb = [
|
|
|
|
grb = random_grb()
|
|
|
|
randint(1, 255),
|
|
|
|
|
|
|
|
randint(1, 255),
|
|
|
|
|
|
|
|
randint(1, 255)
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while True:
|
|
|
|
while True:
|
|
|
|
set_all_leds(device, grb)
|
|
|
|
set_all_leds(device, grb)
|
|
|
|