Hello, I am still a beginner in Python programming. My latest project is this: I have a fly-screen sliding door that my cats can open with their paws. But they're not closing the door! ;) I would now like to use a Raspberry PI, a door contact and a relay that drives a small electric motor. A rubber ...
Hi, first of all, thank you for your help. I tried it, but it doesn't work. When I delete the second break it prints "Equal" all over the display. If selectbootle is the same as formerbottle then a new random. choice shall be performed again until selectbootle is not equal to formerbottle. Then the ...
Hello, in the attached code I add a loop which selects a bottle from a list of bottles. This selection should be saved in a file and checked the next time you run it. If the new selection should be the same as the one saved in the file, then the loop should run until the contents are not the same. T...
Thank you so much, it works fine. But now I've the next problem. I want to select a soundfile from a specific folder. I put in a function called rndmp3. A file in the directory is selected and played back, but when I close the door the playback does not stop. How can I stop the playback of the funct...
I have one more question. If the door is getting closed until the song is playing, the song should stop. Hhow can I interrupt / kill this process? ## Reedcontact starts Audiofile, when Switch is open import time import RPi.GPIO as io import subprocess import os ## set GPIO mode to BCM io.setmode(io....
Good evening, i am new to this forum, maybe the entry here is in the wrong place. I'm programming my Raspberry PI with a reed contact. When the door is opened, an audio file should be played back. So far I managed to do that, see Script, but the OMXPLAYER starts the playback of the song several time...