38 lines
564 B
Python
38 lines
564 B
Python
|
#!/usr/bin/env python3
|
||
|
|
||
|
import sk6812_multistrip as sk6812
|
||
|
import math
|
||
|
import sys
|
||
|
import time
|
||
|
|
||
|
s = sk6812.SK6812(sys.argv[1], 2703)
|
||
|
|
||
|
nled = 16
|
||
|
nstrip = 8
|
||
|
|
||
|
interval = 1/30
|
||
|
|
||
|
for led in range(nled):
|
||
|
for strip in range(nstrip):
|
||
|
s.fade_color(strip, led, 0, 0, 0, 0)
|
||
|
|
||
|
s.commit()
|
||
|
|
||
|
loop = 0
|
||
|
while True:
|
||
|
intensity = int(64 * math.sin(2*math.pi * (loop * interval) * 0.25)**2)
|
||
|
|
||
|
r = 0
|
||
|
g = 0
|
||
|
b = intensity
|
||
|
w = 0
|
||
|
|
||
|
for strip in range(nstrip):
|
||
|
s.set_color(strip, 0, r, g, b, w)
|
||
|
|
||
|
s.commit()
|
||
|
|
||
|
time.sleep(interval)
|
||
|
|
||
|
loop += 1
|