sk6812-client/rundumleuchte.py

34 lines
592 B
Python
Raw Normal View History

2019-12-01 14:21:01 +01:00
#!/usr/bin/env python3
import sk6812_multistrip as sk6812
import time
import math
num_modules = 16
num_strips = 8
interval = 1/30
w = sk6812.SK6812("10.42.7.145", 2703)
w.set_fadestep(0.80/interval)
color = [255, 0, 255, 0]
cur_strip = 0
while True:
for k in range(num_modules):
f = math.sin(math.pi * k / num_modules)
w.add_color(cur_strip, k, f*color[0], f*color[1], f*color[2], f*color[3])
for strip in range(8):
for i in range(num_modules):
w.fade_color(strip, i, 0, 0, 0, 0)
w.commit()
cur_strip += 1
cur_strip %= num_strips
time.sleep(interval)