Code: Select all
#!/usr/bin/python import RPi.GPIO as GPIO import os GPIO.setmode(GPIO.BCM) GPIO.setup(8, GPIO.IN, pull_up_down=GPIO.PUD_UP) input = GPIO.input(8) while True: GPIO.wait_for_edge(8, GPIO.RISING) os.system("pkill thing;/home/pi/thingy&") GPIO.cleanup()
/home/pi/thingy starts thing, and the problem is that when i push "8" i get two instances of thing.
Nothing crucial like the control of nuclear facilities, but anyway i'd like to stop at one instance.
i've added "pkill thing" in /home/pi/thingy in two places a line 1 and just before i start "thing" at the end
btw thing is and audioplayer
do yall get the thing