From 180be6fe6853ad90aae48ce624910ac6d803379b Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 9 Sep 2024 11:09:53 +1000 Subject: [PATCH] src: Use was_pressed in test_record.py. Signed-off-by: Damien George --- src/test_record.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test_record.py b/src/test_record.py index a99696f..ef81f9e 100644 --- a/src/test_record.py +++ b/src/test_record.py @@ -26,7 +26,7 @@ my_track = None while True: - if button_a.is_pressed(): + if button_a.was_pressed(): my_track = microphone.record_into(my_recording, wait=False) display.show([mouth_open, mouth_closed], loop=True, wait=False, delay=150) while button_a.is_pressed() and microphone.is_recording(): @@ -37,7 +37,7 @@ sleep(50) display.clear() my_track *= 2 # amplify volume - if button_b.is_pressed() and my_track: + if button_b.was_pressed() and my_track: audio.play(my_track, wait=False) level = 0 while audio.is_playing():