Skip to content
Commits on Source (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,6 +34,9 @@ class ColorManager(Thread):
def __init__(self):
super().__init__()
self.spi.open(1, 0)
self.lights_off()
def lights_off(self):
ws2812.write2812(self.spi, [(0, 0, 0) * 4])
def get_color(self):
......@@ -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")
......