Sorry, but I forgot to tell you that I have a Raspberry Pi 3 model B V1.2 with a 40 pin header. Now I only used the green colored pins and I wasn't sure if other colors could be used. But if I read the posts correctly it's possible to use the blue, purple and pink also. GREAT !! I did read somewhere...
Hi There, For my project I'm using 17 GPIO pins, but I need one extra. The GPIO pins I'm using are alle the green one's as mentioned here: https://www.raspberrypi-spy.co.uk/2012/06/simple-guide-to-the-rpi-gpio-header-and-pins/#prettyPhoto/1/ Is it possible to use another GPIO pin, for example 2, 3, ...
When I add: if GPIO(7) == 0: time.sleep(0.1) I got an error: if GPIO(7) == 0: TypeError: 'module' object is not callable. When Google this it seems like I need to import something, but I don't see what. I already import the GPIO with import RPi.GPIO as GPIO Can you tell me what I'm suppose to do her...
Hi pcmanbob I'm using this board: https://www.hobbyelectronica.nl/product/relais-module-8-kanaals-5v/ (sorry the page is in Dutch. I'm not using the 5V pin on the Raspberry, but I'm using the 3.3V pin. All my relays are clicking when I set the output to LOW There are 8 buttons. Every button links to...
Hi there, I have 8 buttons defined as input. (GPIO.IN, pull_up_down=GPIO.PUD_UP) The signal is connected from the button, through a resistor, to the input GPIO pin (pins 7,11,13,15,29,31,33 and 35) Pin numbers 12,16,18,22,32,36,38 and 40 are defined as output (GPIO.OUT). Do I need to add an resistor...
After editing the python script and entered the full path to the logging file it works.
No I have to figure out what I can do about debounces.
When I press the button once, the log tells me that is has pressed 2 or 3 times within the same time.
The python script is in /home/pi/ and that's where i'm reffering to in pushbuttons.sh.
So it seems logic to me that logging.txt has to be created in /home/pi
I'll post my complete python script: #!/usr/bin/env python import RPi.GPIO as GPIO import os import sys from subprocess import Popen import time import logging logging.basicConfig(format='%(asctime)s %(message)s',datefmt='%d-%m-%Y %H:%M:%S', filename='logging.txt',level=logging.DEBUG) def button_sto...
I've added the following code in my Python script: import logging logging.basicConfig(format='%(asctime)s %(message)s',datefmt='%d-%m-%Y %H:%M:%S', filename='logging.txt',level=logging.DEBUG) And in the code that correpond with the buttons, i've added logging.info So it looks like this: #If GPIO(7) ...
Hi there, I searched online, but couldn't find an answer, maybe you can. I have a Python script and from that script I can open several mp4 files with a push of a button. (see: https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=276119&p=1673158) So far so good. What I would like to know if its ...
Maybe there is another solution for killing the lights.
When the video is over, the light can go out.
The problem is that I don't know the exact time of each video.
Is it possible to return a status when the video is done en when that status is set, the lights are turn out ?
You are right. I use the wrong numbers. The relays are connected to pin 29 and 30. I have ordered this one: https://www.hobbyelectronica.nl/product/relais-module-1-kanaals-5v/ (sorry, but the page is in Dutch) As I see in the specs it needs 5 volt and pin 2 of the Raspberry would give me 5 volt. If ...
Hi pcmanbob, I want to use 2 relays (for now). I have ordered them, but did not receive them. I want to connect them to pin 14 and 15. This is the code so far (without testing the relay, because I don't have them right now) import RPi.GPIO as GPIO import os import sys from subprocess import Popen GP...
Online I found some code to play a video, with a push on a button. This works great. What I also would like is to use a relay to turn on a lightbulb when the button is pressed. So when the button is pressed, the video will start to play and a light switches on. The light has to turn on for 1 minute....
It's working now !! Many thanks @pcmanbob There was another error after changing time.sleep(2) I also needed to change the word true in the while. It has to be a capital T according to the error log. My code is now this: while True: Time.sleep(2) After booting to Firefox in full screen I can press t...
This is my complete rc.local file: #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By d...
I've added exec > /tmp/rc-local.out 2>&1;set -x in the rc.local file. And the result of the rc-local.out file is: Traceback (most recent call last): File "/home/pi/takepic.py", line 32, in <module> message = input("Waiting for picture\n\n") # Run until someone presses enter EOFError: EOF when readin...
Ok, both codes can work. Now the other problem about autostarting the script. When I boot my Raspberry Pi, it start in desktop mode and opens Firefox fullscreen at http://localhost (and shows an image) When I press the button nothing is happening but I want to create a photo with the script and than...
pcmanbob, Even with your code I can't get it to work, so I did some searching and came across this code. This code seems to work. I can add more commands to be execute and this works. Also I only need 2 wires. One to the 3.3V and one to pin 10 to take a picture. In the code above I needed 3 wires. #...