Go to advanced search

by kempfa
Tue Jun 12, 2018 12:05 pm
Forum: Beginners
Topic: Sliding door
Replies: 4
Views: 577

Re: Sliding door

Hello scotty101,

first of all thank you for your reply.

I thought the script could check the status of the existing door sensor after 10 seconds and if it is not 0, the motor will stop.

Thx!
by kempfa
Thu Jun 07, 2018 9:55 am
Forum: Beginners
Topic: Sliding door
Replies: 4
Views: 577

Sliding door

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 ...
by kempfa
Fri Dec 08, 2017 7:13 am
Forum: Beginners
Topic: Random.Choice and while loop
Replies: 6
Views: 1103

Re: Random.Choice and while loop

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 ...
by kempfa
Thu Dec 07, 2017 5:54 pm
Forum: Beginners
Topic: Random.Choice and while loop
Replies: 6
Views: 1103

Random.Choice and while loop

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...
by kempfa
Sun Nov 26, 2017 5:52 pm
Forum: Python
Topic: Reed contact starts omxplayer several times
Replies: 6
Views: 787

Re: Reed contact starts omxplayer several times

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...
by kempfa
Sat Nov 25, 2017 5:21 pm
Forum: Python
Topic: Reed contact starts omxplayer several times
Replies: 6
Views: 787

Re: Reed contact starts omxplayer several times

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....
by kempfa
Sat Nov 25, 2017 4:13 pm
Forum: Python
Topic: Reed contact starts omxplayer several times
Replies: 6
Views: 787

Re: Reed contact starts omxplayer several times

Thank you Davies it works very well!
by kempfa
Wed Nov 22, 2017 9:07 pm
Forum: Python
Topic: Reed contact starts omxplayer several times
Replies: 6
Views: 787

Reed contact starts omxplayer several times

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...

Go to advanced search