reset_via_button.py hinzugefügt
This commit is contained in:
15
reset_via_button.py
Normal file
15
reset_via_button.py
Normal file
@@ -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)
|
||||||
Reference in New Issue
Block a user