...
 
Commits (2)
......@@ -65,6 +65,7 @@ def main():
stopping.wait()
stopping.clear()
socket.send_string("events abort")
print("Removing callback...")
stage.remove_callback(stage_changed)
stage.remove()
......
......@@ -34,7 +34,10 @@ class ColorManager(Thread):
def __init__(self):
super().__init__()
self.spi.open(1, 0)
ws2812.write2812(self.spi, [(0,0,0) * 4])
self.lights_off()
def lights_off(self):
ws2812.write2812(self.spi, [(0, 0, 0) * 4])
def get_color(self):
if self.current_color.green + self.current_rand > 80:
......@@ -106,6 +109,8 @@ def main():
elif messagedata == b"stage_2_separation":
burn()
cm.start_fade()
elif messagedata == b"abort":
cm.lights_off()
else:
print("Unhandled message")
......
......@@ -45,6 +45,8 @@ def main():
separate_stage_one()
elif messagedata == b"stage_2_separation":
separate_stage_two()
elif messagedata == b"abort":
prime_stages()
else:
print("Unhandled message")
......
......@@ -53,6 +53,8 @@ def main():
pg.mixer.Channel(2).play(stageTwo)
t = Timer(30.0, endMission)
t.start()
elif messagedata == b"abort":
endMission()
else:
print("Unhandled message")
......