I'm sure this has been answered before but I can't seem to find the solution that works.
I am running the latest Raspbian on an RPi 3. I created a bash script named "loop.sh" that loops through two videos. When the first video is playing, a gpio pin sends out a high signal. Once the video is over the signal goes low, it sleeps for a minute and then plays the second video with the same gpio pin going high again and low once the video is over. All of this is within an infinite loop to keep on playing the same two videos with the gpio pin going high to low.
The script works fine when I "manually" start it, but my issue comes when I try to autostart the script (where I will have the RPi installed for the project I won't have access to keyboard or mouse to "manually" start the script).
Right now I have the script at the end of .bashrc and when I power up the pi nothing happens until I open a terminal window, so I added @lxterminal to the autostart file (sudo nano ~/.config/lxsessions/LXDE-pi/autostart). When I reboot the pi like this two instances of the script run at about 5 seconds apart.
Any help to fix this issue will be appreciated as it is the last thing I need to finish this project.