pin number changed
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user