diff options
author | jakob.stendahl <jakob.stendahl@infomedia.dk> | 2022-12-04 13:33:45 +0100 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2022-12-04 13:34:22 +0100 |
commit | c3b4742eeceee9250f8059972dd150f38e2eb021 (patch) | |
tree | edde9ea65b554ff345788a916f238aed4a772b35 /NeoRuntime/Runtime | |
parent | c5dc2dfb92e4a6584d1e727bc39b8c9578f85b57 (diff) | |
download | Luxcena-Neo-c3b4742eeceee9250f8059972dd150f38e2eb021.tar.gz Luxcena-Neo-c3b4742eeceee9250f8059972dd150f38e2eb021.zip |
Fix simulation stuttering (still resource intensive) and some oter QOL upgrades
Diffstat (limited to 'NeoRuntime/Runtime')
-rw-r--r-- | NeoRuntime/Runtime/luxcena_neo/strip.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/NeoRuntime/Runtime/luxcena_neo/strip.py b/NeoRuntime/Runtime/luxcena_neo/strip.py index 0d23069..aa5b2d2 100644 --- a/NeoRuntime/Runtime/luxcena_neo/strip.py +++ b/NeoRuntime/Runtime/luxcena_neo/strip.py @@ -1,9 +1,27 @@ import json from os import path -import rpi_ws281x as ws from .matrix import Matrix, get_segment_range from .power_calc import calcCurrent +""" import rpi_ws281x library, or import dummy version. """ +try: + import rpi_ws281x as ws +except ModuleNotFoundError: + """ Dummy STRIP used for debugging purposes """ + class STRIP: + def __init__(self, *args, **kwargs): pass + def begin(self, *args): pass + def blank(self): pass + def show(self): pass + def setPixelColor(self, *args): pass + def setBrightness(self, *args): pass + """ Dummy ws implementation """ + class WS: + WS2812_STRIP = 1 + Adafruit_NeoPixel = STRIP + def __init__(*args): print("rpi_ws281x is not installed, using a dummy module") + ws = WS() + class Strip: |