From f695723eb12510feae203a014a73832312d56364 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 19 Apr 2025 21:34:46 +0200 Subject: [PATCH] Waiting room: WIP --- waiting/microbit/main.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/waiting/microbit/main.py b/waiting/microbit/main.py index 4c3a942..46b20c0 100644 --- a/waiting/microbit/main.py +++ b/waiting/microbit/main.py @@ -12,11 +12,21 @@ wk = Wukong.WUKONG() wk.set_light(10) wk.set_motors(1, 0) +def gate_open(): + display.show(Image.HEART) + wk.set_servo(0, 90 // 2) + np[1] = (15, 0, 0) + np.show() + +def gate_close(): + display.show(Image.HAPPY) + wk.set_servo(0, 0) + np[1] = (0, 0, 0) + np.show() + while True: if button_a.is_pressed(): - display.show(Image.SAD) - wk.set_servo(0, 90 // 2) + gate_open() if button_b.is_pressed(): - display.show(Image.HAPPY) - wk.set_servo(0, 0) + gate_close() sleep(100) -- 2.39.5