Commit 09a99830 authored by Aljaž Srebrnič's avatar Aljaž Srebrnič

Respond to abort message

parent bea506b4
......@@ -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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment