sk6812-client/random_fader.py

25 lines
417 B
Python
Raw Normal View History

#!/usr/bin/env python
2019-12-01 14:21:01 +01:00
import sk6812
import time
import random
2019-12-01 14:21:01 +01:00
s = sk6812.SK6812("zybot", 2703)
s.set_fadestep(2)
# 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)
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)
2019-12-01 14:21:01 +01:00
#time.sleep(120)