diff options
author | Jakob Stendahl <jakob.stendahl@outlook.com> | 2022-04-28 20:06:38 +0200 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2022-04-28 20:08:55 +0200 |
commit | 916ab40d65c9c25f63256f2cd98be297c3da2208 (patch) | |
tree | dcf07544310fd34f79e72f34ef0e653f30a163f0 /NeoRuntime/Runtime/luxcena_neo/strip.py | |
parent | 4ee57ab935718a269fe7ab65b26ff27837d49003 (diff) | |
download | Luxcena-Neo-916ab40d65c9c25f63256f2cd98be297c3da2208.tar.gz Luxcena-Neo-916ab40d65c9c25f63256f2cd98be297c3da2208.zip |
:bug: Small bugfixes
Diffstat (limited to 'NeoRuntime/Runtime/luxcena_neo/strip.py')
-rw-r--r-- | NeoRuntime/Runtime/luxcena_neo/strip.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/NeoRuntime/Runtime/luxcena_neo/strip.py b/NeoRuntime/Runtime/luxcena_neo/strip.py index d673e1b..0d23069 100644 --- a/NeoRuntime/Runtime/luxcena_neo/strip.py +++ b/NeoRuntime/Runtime/luxcena_neo/strip.py @@ -16,7 +16,7 @@ class Strip: self.LED_PIN = int(strip_conf["led_pin"]) # 18 uses PWM, 10 uses SPI /dev/spidev0.0 self.LED_DMA = int(strip_conf["led_dma"]) # DMA channel for generating the signal, on the newer ones, try 10 self.LED_COUNT = sum(self.SEGMENTS) # Number of LEDs in strip - + # Setup the color calibration array if ("color_calibration" in strip_conf) and (strip_conf["color_calibration"] != ""): self.COLOR_CALIBRATION = strip_conf["led_calibration"] @@ -34,7 +34,7 @@ class Strip: self.__set_brightness = 255 # Keeping what the brightness actually is self.__actual_brightness = self.__set_brightness - + # Setup the strip instance self.strip = ws.Adafruit_NeoPixel( self.LED_COUNT, @@ -50,7 +50,7 @@ class Strip: # Blank out all the LEDs self.blank() - + # Setup matrix print(" * Generating matrix") # try: @@ -58,7 +58,7 @@ class Strip: self.pixelMatrix.dump() # except: # print("Something went wrong while setting up your self-defined matrix.") - + # Read in state file, so we can revoces the last state. self.__globvars_path = path.join(path.split(path.dirname(path.abspath(__file__)))[0], "state.json") if path.exists(self.__globvars_path): @@ -100,7 +100,7 @@ class Strip: self.save_globvars() else: raise Exception("Value ({}) outside allowed range (0-255)".format(value)) - + def _set_brightness(self, value): self.__actual_brightness = value self.strip.setBrightness(value) @@ -145,7 +145,7 @@ class Strip: def get_pixel_color(self, n): """Get the 24-bit RGB color value for the LED at position n.""" return self.strip.getPixelColor(n) - + def blank(self): """Will turn off all pixels, this also calls show for you.""" for n in range(self.LED_COUNT): |