2012-12-27 02:06:36 +01:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2019-12-01 14:21:01 +01:00
|
|
|
import sk6812
|
2012-12-27 02:06:36 +01:00
|
|
|
import time
|
|
|
|
import random
|
|
|
|
|
2019-12-01 14:21:01 +01:00
|
|
|
s = sk6812.SK6812("zybot", 2703)
|
|
|
|
s.set_fadestep(2)
|
2012-12-27 02:06:36 +01:00
|
|
|
|
|
|
|
# dictionary which maps {module: [r, g, b]}
|
|
|
|
set_colors = {}
|
|
|
|
|
|
|
|
while True:
|
2019-12-01 14:21:01 +01:00
|
|
|
r = random.randint(0, 254)
|
|
|
|
g = random.randint(0, 254)
|
|
|
|
b = random.randint(0, 254)
|
|
|
|
w = random.randint(0, 254)
|
2012-12-27 02:06:36 +01:00
|
|
|
|
2019-12-01 14:21:01 +01:00
|
|
|
for i in range(300):
|
|
|
|
s.fade_color(i, r, g, b, w)
|
|
|
|
s.commit()
|
|
|
|
time.sleep(0.01)
|
2012-12-27 02:06:36 +01:00
|
|
|
|
2019-12-01 14:21:01 +01:00
|
|
|
#time.sleep(120)
|