aboutsummaryrefslogtreecommitdiff
path: root/NeoRuntime/Runtime/luxcena_neo
diff options
context:
space:
mode:
authorJakob Stendahl <jakobste@uio.no>2021-10-21 19:28:20 +0200
committerJakob Stendahl <jakobste@uio.no>2021-10-21 19:28:20 +0200
commit6e53fd0dfd830d6d96206419c530c71fa4b3f4e6 (patch)
tree9034a4c9adf3a41c6eb492f2fe6ac06e434275dd /NeoRuntime/Runtime/luxcena_neo
parentf243dc8d7527cde3d5b5a4f6e659cf7604f5ae2a (diff)
downloadLuxcena-Neo-6e53fd0dfd830d6d96206419c530c71fa4b3f4e6.tar.gz
Luxcena-Neo-6e53fd0dfd830d6d96206419c530c71fa4b3f4e6.zip
:sparkles: Add attempt at the "simulation"
Diffstat (limited to 'NeoRuntime/Runtime/luxcena_neo')
-rw-r--r--NeoRuntime/Runtime/luxcena_neo/strip.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/NeoRuntime/Runtime/luxcena_neo/strip.py b/NeoRuntime/Runtime/luxcena_neo/strip.py
index bc2e2be..9a12969 100644
--- a/NeoRuntime/Runtime/luxcena_neo/strip.py
+++ b/NeoRuntime/Runtime/luxcena_neo/strip.py
@@ -119,6 +119,7 @@ class Strip:
def set_pixel_color(self, n, *color):
"""Set LED at position n to the provided 24-bit color value (in RGB order).
"""
+ if n >= self.LED_COUNT: return
c = detect_format_convert_color(*color)
self.TMPCOLORSTATE[n] = c
self.strip.setPixelColor(n, c)
@@ -132,6 +133,7 @@ class Strip:
"""Set a whole segment to the provided red, green and blue color.
Each color component should be a value from 0 to 255 (where 0 is the
lowest intensity and 255 is the highest intensity)."""
+ if segment >= len(self.SEGMENTS): return
for n in get_segment_range(self.SEGMENTS, segment):
self.set_pixel_color(n, *color)