Questions tagged [gpiozero]

This tag should be used for questions relating to Gpiozero, an open-source interface library to control GPIO devices on a Raspberry Pi.

General Purpose Input/Ouput (GPIO) devices on a Raspberry Pi can be controlled using Gpiozero.

More details can be found in the Gpiozero documentation and the main GitHub repository for the project.

83 questions
0
votes
0 answers

Gpiozero wait_for_release not working as it should

I'm trying to build a program that has 2 inputs connected to 2 limit switches and each of these needs to be first opened and then closed before the function respective to each button begins. As a safety feature, I would like to block the code until…
0
votes
1 answer

Nested while patterns in Python

I'm a Python beginner trying to write a script for a Raspberry Pi Zero. The idea is to turn the lights on at dawn and off at dusk, keeping in mind those times change every day. So what i'm after (i guess) is something that will run 24/7 and evaluate…
Gé Fa
  • 96
  • 1
  • 7
0
votes
0 answers

i want to know how to add a second function to the second button connected to my gpio circuit

so i have written this code in my nano editor. the first button which is gpio(21) is functioning properly. the first button (21) is turning the LED's on and off. as for the second button i would like it to change the speed of the LED's flashing once…
0
votes
0 answers

No output when using the shell_exec() function in php to run a python script that imports a gpio library

I am trying to use php to execute a python script, and then retrieve the output of that script for later use. I am running a LAMP server on a Raspberry Pi 4 (set up according to this article…
feddockh
  • 1
  • 2
0
votes
0 answers

Raspberry Pi pins possibly malfunctioning after using button with gpiozero

So my intention was to be able to detect a button press so that I could later light up an LED. However when I use this code written below. It seems that whenever I test button.is_pressed it always says that the button has been pressed, even if there…
Stephen
  • 1
  • 2
0
votes
1 answer

Have a button table instead of a lot of variables

Novice in pyhton AND Raspberry prog, i want to create a Quizz-buzz Game. Up to 8 players can play it. To catch the event when a button is pressed, (using the gpiozero lib) i want to do something like : buttons = [Button(4), Button(5), Button(6),…
Amaury Laroze
  • 197
  • 2
  • 12
0
votes
2 answers

Remote GPIO (Pigpio) with input from laptop and output from Raspberry Pi

I'm working on an object detection project for IoT using a webcam and servo. In short, when the object detected by the webcam matches the data in the system, the servo will move. Can the webcam be connected to the laptop, and the servo on the…
0
votes
0 answers

python this gpiozero method is not working right of the bat

from gpiozero import MotionSensor While true: MotionSensor(17).when_motion() print("motion detected") returns error: Traceback (most recent call last): File "/home/pi/oracle/old/cardtest.py", line 7, in
Dornito
  • 31
  • 3
0
votes
1 answer

Discord.py program using 100% of a core

I have a Discord bot running in python on a Raspberry Pi 3B+. The purpose of this program is to send the lab status to our server by the push of a physical button. I've noticed that the program itself does not always want to cooperate and has been…
0
votes
2 answers

how to fix "TypeError: 'bool' object is not callable"

I'm trying to control a stepper motor with python code. I know this may not be the best way but please just help me and bear with me. I got this working a while ago I'm pretty sure and I have no idea why this isn't working. Please help this is my…
0
votes
0 answers

What environment variables do I need to change to allow pigpio to connect to a raspberry pi remotely?

I am using the gpiozero and pigpio libraries to create a remote gpio control application in python. The pigpio documentation advertises this as a feature, so I know it's possible. Here is the problem with this example code: import gpiozero as…
0
votes
2 answers

Break a while loop when a button is pressed

I am currently trying to setup this code so that when a button in this case button1 connected to a RPi GPIO runs the function c1 and keeps looping that function until another button button2 is pressed and then it runs the function c2 keep looping in…
floxia
  • 67
  • 1
  • 7
0
votes
2 answers

A function is running despite me changing a variable that should stop it

I was hoping someone could help me with this issue. I'm hoping it's fairly simple to fix, but I have been trying for a while to figure this out. I have trimmed my larger code to this, as I believe the issue here is the crux of the problem. I have a…
0
votes
1 answer

Raspberry PI : GPIOZERO on I2C pins

This is on the Raspberry PI. I was able to get the I2C-1 to work properly on the PI using Python. Then I ran another Python script that uses one of the I2C pins as a GPIO using the GPIOZERO library. from gpiozero import LED i2cpin =…
MK0
  • 1
  • 1
0
votes
1 answer

Raspberry PI GPIO Keyboard/Mouse Input

Trying to create very simple keyboard and mouse controller using the Raspberry Pi's GPIO pins. Would love to use the code in a educational setting, so trying to build super easy, readable code for children/students. But the code is acting somewhat…
Pieter-Jan
  • 21
  • 6