From: Martin Mares Date: Sat, 19 Apr 2025 19:34:46 +0000 (+0200) Subject: Waiting room: WIP X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=f695723eb12510feae203a014a73832312d56364;p=home-hw.git Waiting room: WIP --- 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)