From c3b4742eeceee9250f8059972dd150f38e2eb021 Mon Sep 17 00:00:00 2001 From: "jakob.stendahl" Date: Sun, 4 Dec 2022 13:33:45 +0100 Subject: Fix simulation stuttering (still resource intensive) and some oter QOL upgrades --- NeoRuntime/Runtime/luxcena_neo/strip.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'NeoRuntime') 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: -- cgit v1.2.3