Questions tagged [gpiozero]

For questions relating to the python gpiozero library.

27 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
1answer
1k views

How fast can GPIO pins toggle on the Pi 4?

Benchmarking of the Pi 4 using the Python GPIO Zero library shows a significant increase in the frequency of toggling a GPIO pin on and off compared to previous models. This result is attributed to ...
3
votes
0answers
99 views

Raspberry Pi button bug, what is happening?

I am new user of raspberry pi. I have two buttons, and some code to run, yet the led will not react to the buttons. It's probably a easy fix, but keep in mind, I am new to robotic and have only ...
1
vote
0answers
36 views

Can pulse widths on output pins be specified when using the RaspberryPi Gpio library?

According to the AngularServo documentation in the Gpiozero, one can set an angle for a servo (which of course in fact sets a pulse-width), or a value (where 0 is one end of a range and and 1 is the ...
0
votes
1answer
25 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
22 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
34 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 ...
0
votes
0answers
26 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
41 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
24 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
0answers
80 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
70 views

I2C, SPI and Python Libraries with Raspberry Pi 4b

I've been working with RPi.GPIO so far but I have had issues with PWM and edge detection, which are well known issues with RPi.GPIO, anyway, after some research I'm considering using a different ...
0
votes
0answers
64 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
29 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
39 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
54 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
1k 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
308 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
185 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
71 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
305 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
415 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
230 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
82 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
1answer
358 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 ...
-2
votes
1answer
457 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
205 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 ...