Loading lighting.py +6 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ class ColorManager(Thread): current_color = Color(0, 0, 0) activeFlag = True spi = spidev.SpiDev() running = True def __init__(self): super().__init__() Loading Loading @@ -59,6 +60,9 @@ class ColorManager(Thread): if self.current_color.green > 0: self.current_color.green -= 1 def stop(self): self.running = False def start_fade(self): self.activeFlag = False Loading @@ -66,7 +70,7 @@ class ColorManager(Thread): self.unscaled_blue = 0 def run(self): while self.is_alive(): while self.running: if self.activeFlag: self.get_color() else: Loading Loading @@ -111,6 +115,7 @@ def main(): cm.start_fade() elif messagedata == b"abort": cm.lights_off() cm.stop() else: print("Unhandled message") Loading Loading
lighting.py +6 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ class ColorManager(Thread): current_color = Color(0, 0, 0) activeFlag = True spi = spidev.SpiDev() running = True def __init__(self): super().__init__() Loading Loading @@ -59,6 +60,9 @@ class ColorManager(Thread): if self.current_color.green > 0: self.current_color.green -= 1 def stop(self): self.running = False def start_fade(self): self.activeFlag = False Loading @@ -66,7 +70,7 @@ class ColorManager(Thread): self.unscaled_blue = 0 def run(self): while self.is_alive(): while self.running: if self.activeFlag: self.get_color() else: Loading Loading @@ -111,6 +115,7 @@ def main(): cm.start_fade() elif messagedata == b"abort": cm.lights_off() cm.stop() else: print("Unhandled message") Loading