35 lines
618 B
Python
Executable File
35 lines
618 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import sk6812_multistrip as sk6812
|
|
import time
|
|
import math
|
|
import sys
|
|
|
|
num_modules = 16
|
|
num_strips = 8
|
|
|
|
interval = 1/20
|
|
|
|
w = sk6812.SK6812(sys.argv[1], 2703)
|
|
|
|
color = [0x20, 0x40, 0x00, 0x10]
|
|
|
|
cur_strip = 0
|
|
|
|
while True:
|
|
w.set_fadestep(int(0.80/interval))
|
|
for k in range(num_modules):
|
|
f = 1#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)
|