47 lines
755 B
Python
Executable File
47 lines
755 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import sk6812_multistrip as sk6812
|
|
import math
|
|
import sys
|
|
import time
|
|
import random
|
|
|
|
s = sk6812.SK6812(sys.argv[1], 2703)
|
|
s.set_fadestep(1)
|
|
s.commit()
|
|
time.sleep(3)
|
|
|
|
s.set_fadestep(1)
|
|
|
|
nled = 16
|
|
nstrip = 8
|
|
|
|
interval = 1/20
|
|
|
|
for led in range(nled):
|
|
for strip in range(nstrip):
|
|
s.fade_color(strip, led, 0, 0, 0, 0)
|
|
|
|
s.commit()
|
|
|
|
loop = 0
|
|
while loop < nled:
|
|
led = loop
|
|
|
|
for strip in range(nstrip):
|
|
intensity = 48 + random.randint(0, 32)
|
|
|
|
g = 0
|
|
r = intensity * loop // nled
|
|
b = 1*(intensity - intensity * loop // nled) / 2
|
|
w = 0
|
|
|
|
s.set_color(strip, led, r, g, b, w)
|
|
s.fade_color(strip, led, 0, 0, 0, 0)
|
|
|
|
s.commit()
|
|
|
|
time.sleep(interval)
|
|
|
|
loop += 1
|