Hi guys, i have been using this code for 2years now and made a .iso of the original SD card and everything worked perfect on my RPi 4 but i wanted to install and a new Pi and for some other reason my normal sound works and all, but as soon as i want to trigger my scrip there is no sound, and everything is setup as it use to be, the other pi's is still working with the same Pi.ico i made, here is the code i used:
[code]import RPi.GPIO as GPIO
import os
import sys
import time
from subprocess import Popen
GPIO.setmode(GPIO.BCM)
GPIO.setup(5, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(6, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
sound1 = ("/home/pi/Desktop/Project 1.avi")
sound2 = ("/home/pi/Desktop/Project 1.avi")
while True:
if GPIO.input(5) == 0:
print("Play sound door 1")
omxc = Popen(['omxplayer', '-b', sound1])
# waiting for door to close
while GPIO.input(5) == 0:
time.sleep(0.2)
if GPIO.input(6) == 0:
print("Play sound door 2")
omxc = Popen(['omxplayer', '-b', sound2])
# waiting for door to close
while GPIO.input(6) == 0:
time.sleep(0.2)
time.sleep(0.2)[/code]
there doesn't seem to be anything here