From 1522032a362251e4ae2d21c271b063ee979b9791 Mon Sep 17 00:00:00 2001 From: cpu Date: Tue, 12 Dec 2023 19:52:52 +0100 Subject: [PATCH] pin number changed --- kukuc-clock.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/kukuc-clock.py b/kukuc-clock.py index ba047b7..85ac449 100644 --- a/kukuc-clock.py +++ b/kukuc-clock.py @@ -11,9 +11,9 @@ else: import RPi.GPIO as GPIO BUTTON_TIMEOUT = ( - 30 # pressing and holding the button longer then e.g. 2 seconds terminates playing + 30 # button release timeout terminates playing ) -PIN = 17 # listen to changes on this GPIO +PIN = 27 # listen to changes on this GPIO pin GPIO.setmode(GPIO.BCM) # use BCM pin layout GPIO.setwarnings(False) @@ -39,7 +39,7 @@ def play_presny_cas(): def play_beep(): print("Playing beep.wav") - subprocess.call(["aplay", "beep.wav"]) + subprocess.run(["aplay", "beep.wav"], check=True) def get_credentials(): @@ -56,16 +56,11 @@ def generate_presny_cas(): username, password = get_credentials() subprocess.call( [ - "curl", - "--silent", - "-u", - f"{username}:{password}", + "curl", "--silent", "-u", f"{username}:{password}", "--get", - "--data-urlencode", - f"text={text}", + "--data-urlencode", f"text={text}", "https://tts.virtonline.eu/api/tts", - "--output", - "presny_cas.wav", + "--output", "presny_cas.wav", ] ) print("Generated presny_cas.wav") @@ -104,6 +99,6 @@ try: except Exception as e: print("Caught exception: ", e) - + sys.exit() finally: GPIO.cleanup()