I'm trying to create a very simple python script that waits for a GPIO button press and then runs a shell script. I personally don't know much about python so what I've come up with is mostly from other sources with a similar issue.
import RPi.GPIO as GPIO
import time
import os
GPIO.setmode(GPIO.BCM)
GPIO.setup(16,GPIO.IN)
input = GPIO.input(16)
while True:
inputValue = GPIO.input(16)
if (inputValue == False):
os.system("scan.sh")
So once the button on pin 16 is pressed, I need it to run the shell script "scan.sh". However when I run the python script it repeats
sh: 1: scan.sh: not found
and control+c won't end it. Nothing changes whether the button is pressed or not. What do I need to change?
scan.sh
?