Questions tagged [gpiozero]

For questions relating to the python gpiozero library.

Filter by
Sorted by
Tagged with
0
votes
1answer
532 views

GPIOs of Pi3 not working

Problem Description I have experienced some problems with the GPIOs on my Pi3. From one day to another the MotionSensor and the LED strip that where connected to the GPIOs stopped working while the ...
0
votes
1answer
667 views

Ultrasonic program in raspberry pi stops working after some time

Below is the code I'm running on my raspberry pi zero to detect the range by Ping))) ultrasonic. after some time (ex: 300 pings) the program uses most of the CPU (90%) and then it stops working, is ...
0
votes
1answer
61 views

Raspberry Pi Zero get 5 V directly from the input

I have a Raspberry Pi Zero and I would like a tiny fan which draws 90 mA. Obviously, I can't connect it to the GPIO pins and therefore I need to get 5 V from the input cable. Before I ...
0
votes
1answer
732 views

gpiozero: Ignore false positives/negatives

I've seen several threads where users experience some noise fluctuation in the GPIO input readings, for instance, without any physical change to a Button's state, the events when_released/when_pressed ...
0
votes
1answer
829 views

GPIOzero motor backward and forward pins

When creating a new motor object from the GPIOzero module like this: import gpiozero, then motor1 = gpiozero.Motor() you need to specify the backward and forward pins. What does that mean and what if ...
0
votes
1answer
84 views

Using gpiozero and RPi.GPIO in one script

I use the gpiozero.MotionSensor to detect motion and upon motion to change the state of GPIO pin 17 using RPi.GPIO. This works well. At the end of the script I clean up using RPi.GPIO.cleanup(), but ...
0
votes
1answer
64 views

Show boot info on character LCD

Is it possible to show boot log or info on a character LCD that the Raspberry Pi is still booting? I'm using a generic 16x2 character LCD
0
votes
1answer
117 views

How to wire a button

O have tried to do this so many times, so many websites, so many books, and it just won't work. I do not know how to wire it so that the LED lights up when I press the button. I'm pretty sure that I ...
0
votes
1answer
110 views

MC3008 vs. Justboom amp

I just ordered the Justboom AMP Zero pHAT. My project needs reading analog signals, too. So I also ordered a MCP3008 in order to convert from analog to digital. My question: is it possible to connect ...
0
votes
2answers
277 views

Weird LED behaviour

I run my program: from gpiozero import PWMLED ledpins = [2, 3, 4] z = 10 for i in ledpins: PWMLED(i).blink(on_time=1/z, off_time=1/z, n=3) I tried it and got: Exception Exception ...
0
votes
1answer
47 views

RPi.GPIO: multiple buttons one callback function, ignore buttons while callback is executing

I have 4 buttons connected to my Raspberry Pi that call the same function when pressed. I'm using GPIO.add_event_detect to connect the buttons to the callback function. When one button press executes ...
0
votes
1answer
36 views

gpiozero button to raise SystemExit / gpiozero clash with GPIO.cleanup()

TL;DR: Since this is a long question I have the following problems: I'm looking for a good way to use gpiozero Button to raise SystemExit upon button press I have an imported module to drive an E-Ink ...
0
votes
0answers
24 views

Robot Function Queue

I'm trying to build a restful microservice that controls my robot. Basically, someone(or an app) can hit a URL and move my robot. This is just for fun on my local network. So far, it works well enough ...
0
votes
1answer
25 views

Python tkinder reset button code fails on third attempt

I am trying to trigger a timer when there is audio and stop the timer when the audio is lower than a set value. There is a reset button that will reset the timer back to zero. The reset button works ...
0
votes
1answer
58 views

gpiozero's LED.toggle() switches LED again after some seconds

I am using the gpiozero library to controll a LED strip and a relay connected to my raspberry pi 4. This is the way I connected the LED strip to the pins. I use a type SMD5050 LED strip similar to the ...
0
votes
0answers
27 views

Fast/efficient code to wait for trigger, trigger causes camera to collect image stream, process, wait for trigger, wash rinse repeat

I am working on a project to detect trained objects with google coral once I capture images (temporarily, i.e. cache) upon an external trigger. The focus here is the front end trigger and capture ...
0
votes
1answer
52 views

Register button presses within button press function?

I'm working with code that looks something like this: from time import sleep from gpipozero import Button BUTTONS = { 'start': Button(21), 'choice_1': Button(1), 'choice_2': Button(7), } ...
0
votes
0answers
29 views

Why don't my LEDS stay on when the guizero buttons are pressed?

I wrote a simple python dashboard, using guizero and gpiozero, to turn LEDS on and off. I only have a problem with the LEDS, they only turn on for 1 second before they turn off. I tried to use time....
0
votes
1answer
80 views

Long/short button press doesn`t work with IF statements - Need some help [closed]

I am trying to build a simple game and I have the following problem. My code is executed but the button presses cannot be detected whatever I am trying. There are no errors and I cannot figure out why ...
0
votes
0answers
111 views

PIR sensor connection to the Raspberry Pi not working

I'd like to connect a PIR sensor (HC-SR501) to the Raspberry Pi, namely GPIO BCM 4. But the pin level always reads as 0. If I assemble a standalone circuit with PIR (its OUT pin - resistor - LED - GND)...
0
votes
0answers
74 views

when_pressed and when_released functions in gpiozero not working

I have the following code, and I cannot figure out how to make when_pressed and when_released work. The callback functions just do not run to the press and release. On the other hand, properties such ...
0
votes
0answers
32 views

How can I control pins with node js + gpiozero + signal?

I have a project written in python using the gpiozero library controlling some buttons, an LCD, and some LEDs. The file follows the format of setting callback functions, defining event handlers, and ...
0
votes
0answers
41 views

Interrupt Servo once movement has initiated

I'm new to python and RPis. I'm building my own robot to learn. I manage to control my little robot and move it around, as well as moving the pan camera with my keyboard. While I was searching for a ...
0
votes
0answers
61 views

HC-SR04 Ultrasonic Rangefinder readings are way off

So im trying to make my Robot move by itself and then make a turn until the path is clear using the HC-SR04 Ultrasonic Rangefinder, but my problem is that my readings are off with a large margin, ...
0
votes
1answer
2k views

How to toggle button on and off with gpiozero?

I can't seem to find a solution of doing this using gpiozero. I've done it using rpi.gpio with add_event_detect and call back to change state but I was under the impression gpiozero is much simpler. ...
0
votes
0answers
352 views

GPIO LED is constantly on. GPIOZero can't turn it off

If power is supplied to the Pi then the LED will be on by default. I've got the LED connected to GPIO pins [4, 6] and the script can not turn it off. I've switch the cables around and that's resulted ...
0
votes
0answers
203 views

I want to toggle a button from GUI tkinter and display a counts from GPIO

I want to toggle a button from GUI tkinter and display a counts from GPIO. Here I have a counter system code: from gpiozero import * from time import sleep #####GPIO input########## led = LED(26) ...
0
votes
0answers
76 views

re error in using gpiozero

I am new to RPi, though have lot of experience with Arduino. I recently installed the 'gpiozero' module to my RPi system, and while trying to run a simple LED on-off file, I encounter an error......
0
votes
0answers
346 views

gpiozero robot control

I have to control motors of my Braitenberg vehicle using robot class of gpiozero. Sometimes I have to turn my robot reverse direction either in left or right. But this thing is not happening. I am ...
0
votes
1answer
435 views

Wiring Omron D6T Thermal Sensor to Raspberry Pi Zero W with Adafruit T-Cobbler Plus

I have a Raspberry Pi Zero W connected to a Adafruit T-Cobbler Plus and breadboard. My question is regarding wiring. I have followed tutorials to create simple circuits, however, I am struggling to ...
0
votes
0answers
102 views

HTTPServer / FTPServer loop colliding with callback thread

I am building an alarm application. I have a few PIR sensors and webcams. The application contains a webserver I use to manage the alarm from a mobile application done with kivy.The webcams upload ...
0
votes
0answers
232 views

Python, RpiZero and gpiozero

I'm coding on Rpi3 using python3. When trying to run a code, containing a gpiozero lib - it fails when running on RpiZero, while succeeds on Rpi3. RpiZero contains gpiozero lib Trying to find the ...
0
votes
1answer
239 views

Running Flask on Pi Zero getting uneven PWMLED

This is my first trial run using a Raspberry Pi Zero W to run RGB LEDs following this tutorial: https://dordnung.de/raspberrypi-ledstrip/ I've completed the tutorial, have everything wired up, and ...
0
votes
2answers
2k views

function button.is_pressed from gpiozero do not work

Im working on a university project with raspberry and gpiozero. I need to manage the button response to take diferent actions. The problem is that de function button.is_pressed its always true (even ...
0
votes
1answer
83 views

pi camera will not work with Pi zero

My Pi camera will not work with the Pi zero using the same python code I use on my Pi 3 or Pi 2 Is there something I am missing?
-1
votes
2answers
129 views

Problems with the rpi zero and relay [closed]

I Have a problem... (above the relay-coil Datasheet) I want to control a single relay with my pi zero, but it seems that it doesn't have enough power. the 3.3V pin of the rpi (measured to 3.19V) works ...
-1
votes
1answer
60 views

second motor won't stop unless I disconnect power

I am using an L298N board and two pi yellow pi servos and a program on my pi to control everything: # Driving One Motor Using GpioZeo and L298N v0.01 tlfong01 2019jun11hkt1156 # rpi3B+ python 3.5.3 ...
-1
votes
2answers
57 views

LEDs not turning off after Raspberry Pi power down

I have a Raspberry Pi with six LEDs and button (also with LED) on the custom circuit board that is connected to GPIO pins. This RPi previously had an AdaFruit Neopixel with LEDs, but later my client ...
-1
votes
1answer
49 views

How to know if a pin is assined in raspberry pi?

I'm "playing" with Django and I'm trying to read the state of a pin when a button is pressed using gpiozero. I'm able to do this without trouble outside Django, meaning that I can detect ...
-1
votes
1answer
523 views

function to wait for any of the buttons press

I'm working on a project that use four buttons to navigate in a menu. The root options of the menu have nested options etc. The buttons don't have hardware de-bouncing. My ultimate objective is to ...
-1
votes
1answer
35 views

How to make lilypad temperature sensor work with raspberry pi zero?

I discovered a lilypad sensor thought of connecting it with raspberry pi zero to measure living room temperature. But lilypad sensor is analog input and pi doesn’t have analog pin. How can i make ...
-2
votes
3answers
56 views

What is simplest Python code to call the begin_time function with the value of time equal to 5 when the launch Button is pressed?

I have the following code: def begin_time(time): print(time) from gpiozero import Button begin = Button(27) I want to call this function with time = 5 Any help would be appreciated
-2
votes
1answer
463 views

gpiozero : Not working, no error messages

I can't make gpiozero to work. Here is my config: raspbian on raspberry 3B V1.2 $ python -V return: python 2.7.13 $ python3 -V return: python 3.5.3 which mean that I have several version of ...
-2
votes
1answer
216 views

Understanding the GPIO pins

I've not yet got into the GPIO pins. Can someone help me understand how they work? Are some of them special in some way? Do certain pins produce certain polarities or is that software defined? What ...

1
2