Exemplo n.º 1
0
#!/usr/bin/env python3

from pixelpi import Strip
import time

strip = Strip(4, (8, 32), shape="zmatrix", ledtype='WS2812', brightness=30)

for x in range(strip.getWidth):
    strip.setLEDs(led=(x, 0), rgb=(128, 0, 0))

strip.showLEDs()

try:
    while True:
        strip.shift("up", 2)
        strip.showLEDs()
        time.sleep(0.2)

except KeyboardInterrupt:
    strip.clearLEDs()
    strip.showLEDs()
    del strip
Exemplo n.º 2
0
#!/usr/bin/env python3

import time

from pixelpi import Strip

strip1 = Strip(1, 180, ledtype='WS2811_GRB', brightness=50)
strip2 = Strip(2, 180, ledtype='WS2811_GRB', brightness=50)
strip3 = Strip(3, 180, ledtype='WS2811_GRB', brightness=50)
strip4 = Strip(4, 180, ledtype='WS2811_GRB', brightness=50)

strip1.clearLEDs()
pattern = strip1.getLEDs()

for pixel in range(int(len(pattern) / 2)):
    pattern[pixel] = [255, 0, 0, pattern[pixel][3]]
    pattern[strip1.getLength - pixel -
            1] = [0, 0, 255, pattern[strip1.getLength - pixel - 1][3]]

for strip in [strip1, strip2, strip3, strip4]:
    strip.setLEDs(pattern=pattern)

try:
    while True:
        for strip in [strip1, strip2, strip3, strip4]:
            strip.mirror()
            strip.showLEDs()
        time.sleep(1)

except KeyboardInterrupt:
    for strip in [strip1, strip2, strip3, strip4]: