From 9d5df124795c74600f4568d55cf82822f31ec52f Mon Sep 17 00:00:00 2001 From: talksik Date: Thu, 27 Apr 2023 14:00:01 -0700 Subject: [PATCH] different order --- push_to_record_and_play.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/push_to_record_and_play.py b/push_to_record_and_play.py index e6cd4ab..623531f 100644 --- a/push_to_record_and_play.py +++ b/push_to_record_and_play.py @@ -12,10 +12,11 @@ GPIO.setup(BUTTON, GPIO.IN) audioInstance = audio.Audio() while True: - state = GPIO.input(BUTTON) if audioInstance.isRecording(): audioInstance.readChunk() + state = GPIO.input(BUTTON) + if state: print("button: OFF") if audioInstance.isRecording():