From ac9bf8c39dfc7bc5320c2b85ea93258cd3eb15a8 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 26 Feb 2026 19:55:44 +0000 Subject: [PATCH] =?UTF-8?q?reset=5Fvia=5Fbutton.py=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reset_via_button.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 reset_via_button.py diff --git a/reset_via_button.py b/reset_via_button.py new file mode 100644 index 0000000..a5d1bd5 --- /dev/null +++ b/reset_via_button.py @@ -0,0 +1,15 @@ +import RPi.GPIO as GPIO +import time +import subprocess + +BUTTON = 17 + +GPIO.setmode(GPIO.BCM) +GPIO.setup(BUTTON, GPIO.IN) + +while True: + state = GPIO.input(BUTTON) + if not state: + #print("BUTTON PRESSED!") + subprocess.Popen(["sh", "/home/pi/radio/end_radio.sh"]) + time.sleep(0.5) \ No newline at end of file