forked from pvx/litsimaja
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
816 B
33 lines
816 B
from rpi_ws281x import PixelStrip |
|
from lib.FakeStrip import FakeStrip |
|
from lib.LoopSwitch import LoopSwitch |
|
|
|
|
|
class Litsimaja(object): |
|
_strip: PixelStrip |
|
_loops: [] |
|
|
|
def __init__(self): |
|
self._strip = FakeStrip(290, 18, 800000, 10, False, 255, 0, 4104) |
|
self._loops = [] |
|
self._strip.begin() |
|
|
|
def count_pixels(self) -> int: |
|
return self._strip.numPixels() |
|
|
|
def get_strip(self) -> PixelStrip: |
|
return self._strip |
|
|
|
def set_pixel_color(self, n: int, color: int) -> None: |
|
self._strip.setPixelColor(n, color) |
|
|
|
def show(self) -> None: |
|
self._strip.show() |
|
|
|
def add_loop(self, loop: LoopSwitch): |
|
self._loops.append(loop) |
|
|
|
def clear_loops(self): |
|
for loop in self._loops: |
|
loop.stop() |
|
self._loops.clear()
|
|
|