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
1
vote
1 answer

RPi.GPIO problems on PI 4b

"This module can only be run on a Raspberry Pi" error when using RPi.GPIO on Raspberry Pi 4b. This error was caused by the default RPi.GPIO version installed with: python3 -m pip install RPi.GPIO This command seems to install a version which is…
Tom
  • 21
  • 4
1
vote
1 answer

How to test a RGBLED without Raspberry Pi connection?

I was working with gpiozero and wanted to use the MockFactory to debug on a local device without Raspberry Pi (4) connection. The last time I used the Mockfactory was with an gpiozero.LED object. But this time I used a gpiozero.RGBLED output device.…
1
vote
4 answers

Use asyncio with non asynchrone callback method from external library

I'm using the gpiozero python library to handle simple GPIO devices on a Raspberry Pi (I use here a MotionSensor for the example): import asyncio from gpiozero import MotionSensor class MotionSensorHandler(): __whenMotionCallback = None …
johannchopin
  • 13,720
  • 10
  • 55
  • 101
1
vote
2 answers

how can I use gpiozero robot library to change speeds of motors via L298N

In my raspberry pi, i need to run two motors with a L298N. I can pwm on enable pins to change speeds. But i saw that gpiozero robot library can make things a lot easier. But When using gpiozero robot library, how can i alter speeds of those motors…
Buddhika Bandara
  • 351
  • 1
  • 11
1
vote
1 answer

Using a button to quit rock paper scissors game

New to programming, please bear with me....... I have a rock/paper/scissors game that works perfectly. I know I probably could have done it with 10% of the code I actually used, but please use my code to explain to me, it's how I understand it at…
Frans
  • 19
  • 3
1
vote
2 answers

Python 3.7 import gpiozero ModuleNotFoundError No module named 'gpiozero' on raspberry pi zero

Built Python 3.7 on my Raspberry pi zero in a attempt to upgrade from Python 3.5.3 The build was successful, ran into the module not found for smbus and switched that to smbus2, now when I import gpiozero I get Module not found. my DungeonCube.py…
Garry Osborne
  • 87
  • 2
  • 4
  • 11
1
vote
0 answers

Where does this timestamp come from? (LED priority signal)

I have this code and it runs two times fine, while on third call I get an error, as if I would have passed Timestamp. I only ever pass Tuple or None. from pprint import pprint from gpiozero import RGBLED def signal(pri, newcolor): …
Jakub M.
  • 321
  • 2
  • 7
0
votes
0 answers

I tried to include gpiozero in my custom build with yocto project with raspberry pi 3

ERROR: core-image-base-1.0-r0 do_rootfs: Could not invoke dnf. Command '/home/jakinboy/projects/build_folder/build_rpi/tmp/work/raspberrypi3_64-poky-linux/core-image-base/1.0-r0/recipe-sysroot-native/usr/bin/dnf -v --rpmverbosity=info -y -c…
0
votes
0 answers

Can't install approxeng.input==2.6.3

I am making a weird robot out of k'nex and a pi and I am controlling it over bluetooth with a DS4. The motor The controller The DS4's D-pad will control the movement. I was looking for librarys to drive the controller, and I found approxeng.input.…
0
votes
0 answers

Passing data to GPIO pins in python on Raspberry Pi

A raspberry pi is connected to three stepper motor controllers. Each controller needs two gpios: one for direction (high is clockwise, low is counterclockwise), and one for a step signal. Setting a GPIO high and low again will trigger a step of the…
Nuke
  • 19
  • 1
0
votes
0 answers

Remote Control of Continuous (360) Servo

I currently have a python script that works perfectly for 180 Servo. I have to run from my Windows computer because the model is stored here. So I'm sending the Pi a command via gpiozero. from gpiozero import Servo from gpiozero.pins.pigpio import…
user2607686
  • 47
  • 2
  • 8
0
votes
0 answers

The code stops and not wait for me to press the button

When I run the code import RPi.GPIO as GPIO from gpiozero import Button button = Button(21) from mfrc522 import SimpleMFRC522 reader = SimpleMFRC522() id, text = reader.read() if (text == "benfica"): button.wait_for_press …
yesn't
  • 1
  • 1
0
votes
1 answer

Servo jittering and not turning fully

I started a project with servos, making a crude robotic arm, with two servos. the issue is, that my servo keeps jittering when stationary, sometimes too much, and can cause the thing to fall over. Also, whenever i enter an angle for the servo to…
0
votes
0 answers

Remote GPIO via gpiozero SBC-Moto1 slow execution

I am pretty new to the Raspberry Pi. I'm trying to run a stepper-motor, which is connected with my raspberry, with my windows computer. I'm using the library gpiozero. The Code on my Raspberry is working correctly and also pretty fast so the…
0
votes
0 answers

Can't connect to pigpio at 192.168.1.3(8888)

I want to get the temperature of the cpu but each time it thorws a error I also used different libraries but it still it shows some error. from gpiozero.pins.pigpio import PiGPIOFactory factory = PiGPIOFactory(host='192.168.1.3') cpu =…
Praveen Kumar
  • 199
  • 11