Questions tagged [rpi.gpio]

rpi.gpio refers to the package name of a Python module for accessing the Raspberry Pi's GPIO pins. The module allows GPIO pins to be initialised, turned on, and turned off. It uses a functional programming style.

Filter by
Sorted by
Tagged with
0 votes
0 answers
4 views

How do I stop the code from stopping

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 == "...
  • 1
0 votes
0 answers
27 views

Raspberry PI locking/unlocking system

I have a door lock connected to RPi and I would like to unlock and lock doors by remote control. My idea was to make a separate server in the Cloud and that this server pushes an event (lock/unlock) ...
1 vote
1 answer
48 views

reading pulse count using raspberry pi in python [closed]

I have been trying to read the number of pulse inputs from an external device. The pulse generated is from the arduino uno, and the pin I am using has a frequency of 450hz with 5% duty cycle. Every ...
2 votes
2 answers
39 views

HC-SR04 sensor's ECHO pin stuck on HIGH

I have a raspberry pi 4 and a HC-SR04 ultrasonic distance sensor. I want to use it in a raspberry-pi based robot. The other features look fine, the robot can move, et cetera. But my code for the ...
0 votes
0 answers
38 views

I don't have ribbon cable for GPIO, and I need to use a bunch of jumper wires

I wanna use individual jumper wires but I don't know how to connect them properly to my raspberry. I'm using the red T-shaped GPIO extension board and raspberry pi 3, I already put all my wires in the ...
0 votes
4 answers
85 views

Switching a bistable latching Relay directly - Not enough power from GPIO?

I'm trying to control this bistable latching Relay (RT314F03) After not being able to switch the relay I was wondering if that's even possible. While the Relay is rated for 3V, it's "Rated Coil ...
  • 9
1 vote
0 answers
34 views

Command Raspberry Pi 4 GPIO via bash Windows 10

from RPi import GPIO global ON global OFF OFF = GPIO.LOW ON = GPIO.HIGH GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(21, GPIO.OUT) x = open(testo.txt") if x.read() == "true"...
1 vote
1 answer
42 views

Pin state doesn't change, but wait_for_edge triggers

I've been trying to figure out why the GPIO value will not change. I double check, triple check my connections. I used GPIO.wait_for_edge(pin, GPIO.RISING) and it executed and when I ran print(GPIO....
0 votes
0 answers
38 views

How to stop recording with GPIO

I am trying to make a phone that you can leave a message on. I have it almost ready, however i'm struggling with one item. When the user picks up the phone, it will play a message, then beep and start ...
0 votes
1 answer
41 views

why GPIO does not work when executed from python shell but works from script

When I run this python script led.py it works. import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(24,GPIO.OUT) print("LED on") GPIO.output(24,GPIO....
0 votes
0 answers
64 views

How can I figure out my Python code with Kivy and Raspberry Pi GPIO?

I try to add actionbar to all screenmanagers in Kivy 2.1.0. I found some solution to my problem but I added some more features like GPIO pinout from Raspberry Pi. Here is a solution without gpio. I ...
0 votes
0 answers
55 views

Continuous servo takes time to stop?

I am using a Raspberry Pi 3 to control a modified TowerPro SG90 servo, where I have removed the potentiometer to make a continuous rotation servo. Using the code below, the motor starts exactly when I ...
0 votes
0 answers
28 views

Activate or disactivate GPIO with another computer (with python)

I am doing a project and I tried to use my raspberry pi's gpio with another computer. I want that my computer send to the raspberry pi a signal with wifi (my raspberry pi is a local server) to ...
0 votes
0 answers
32 views

Active high relay for Raspberry and Tents control

I would control a board for motorized tents with Raspberry. My wish is to have a touch panel for moving up and down the tents. The problem is: how can I send the input to the switches on the tents ...
0 votes
1 answer
39 views

RGB Matrix interfering with GPIO button

I have a Raspberry Pi 4 running Raspbian Lite. On that I soldered an Adafruit Hat + RTC and connected Adafruit 64x32 RGB Matrix. I have also connected a GPIO push button to pin 5 & GND#4 For the ...
-1 votes
1 answer
48 views

signaling Raspberry Pi with PLC

I want to give signal via PLC to Raspberry Pi and when the raspberry pi gets that signal, it should run the python script and when the python script execute properly and cycle is completed, it should ...
  • 1
0 votes
2 answers
71 views

How to set PWM to actual 0

I am controlling a stepper motor using PWM on a RPi 4 and python. The motor has a controller/driver (BLDC-8015A) that accepts 0-3.3V to set the rotational speed. According to the documentation, this ...
0 votes
0 answers
69 views

Help! Designing a 3 push button circuit that sends emails

First time posting here. I'm in a bit of panic mode because I need to deliver a project this Wednesday and I'm having issues with my coding. As the title says, I'm using a circuit of three push ...
1 vote
0 answers
91 views

Python code not working: Programming a motor to turn on using a switch (Raspberry Pi)

HELP! Ideally within the next 24hrs PLEASE!!!!! We have a simple circuit where we have a button, that when pressed, starts a motor that needs to run at a certain speed for a certain amount of time. (...
  • 11
1 vote
0 answers
57 views

Not getting an GPIO output

I am trying to light a led with the raspberry pi 3b, but I am failing to get an output. I connected the LED to physical pin #11: [img]https://i.imgur.com/TYeJc10.jpg[/img] And to physical pin #6(...
0 votes
2 answers
137 views

How can I read the current ALT-Mode of a GPIO PIN?

i have a Hyperpixel 4.0 Touchscreen, which i use one my Raspberry PI 3b+ This Touchscreen is attached directly on the 40 GPIO-Pins and a few Pins have some special Alt-modes. Out of personal Interest, ...
0 votes
1 answer
480 views

AttributeError: module 'RPi.GPIO' has no attribute 'ChangeDutyCycle'

Starting Day 2 troubleshooting this error. Code used to work on a previous rasp pi 4B but doesn't on a new one so I'm assuming I'm missing some breaking change. Problem: Using import RPi.GPIO as GPIO ...
  • 153
1 vote
1 answer
140 views

How to check on which OS system the python program is running to import rpi.gpio?

Is there an easy way to let a python program check if it running on the raspberry Pi or the pc running windows? I would like to use this to automaticly use the rpi.gpio functions in my code. I am ...
  • 13
2 votes
1 answer
292 views

Controlling stepper motor with Raspberry pi

I am building a sorting machine for a project where I want to sort the balls based on their color. For the actual sorting mechanism I am using a stepping motor (NEMA 17 with Driver DRV8825). I ...
2 votes
3 answers
112 views

Rpi GPIO code not working

Following commands work well as full speed PWM. echo "s 18 2000" >/dev/pigpio pigs s 18 2000 But following code do nothing. I am using Raspberry Pi4 8G B model import RPi.GPIO as GPIO ...
-1 votes
1 answer
75 views

How to assign one input when matrix keypad key is held down?

I have a simple matrix 3x4 keypad that executes a function based on the code entered. However I'm running into the issue when someone holds down a key. I would like it to where only one value is ...
  • 1
0 votes
0 answers
111 views

python module 'spidev' not found

python software from pi plates doesn't work with python 3.10. One specific is that 'import spidev' cannot find spidev module. Any suggestions?
0 votes
1 answer
245 views

ERROR: PWM Generation using pigpio C library

I am working on the RPI-CM4 board with raspbian buster OS. I am trying to generate the 38KHz PWM wave using pigpio the library. My code is as follows. #include <pigpio.h> #include <unistd.h&...
-1 votes
1 answer
105 views

Can you use gpiozero wait_for_press() inside of a callback triggered by add_event_detect?

I am trying to write a script that uses a GPIO interrupt to callback a function that starts by playing a sound and then waits for a button to be pressed to start recording a sound, and then waits for ...
0 votes
1 answer
434 views

Install GPIO problem

It seems like I cannot download GPIO...
-1 votes
1 answer
67 views

need to avoid callback is triggered when changing gpio modes

I have following code and I need to run it so, callback is not triggered when changing gpio mode from OUT to IN. Is this manageable with this library? import pigpio, time _gpin_a = 27 pi_gpio = ...
0 votes
0 answers
34 views

Raspberry Pi Pin 17 Displaying Abnormal Behavior

I found that GPIO 17 (there was a switch wired up to it) had abnormal behavior. I have wired up a hall effect sensor on pin 18, but when it goes low (it is high when not detected, low when detected), ...
1 vote
1 answer
234 views

Raspberry Pi Zero GPIO pin not detecting Input

So I am using a Raspberry Pi Zero to detect the signal from this NPN Inductive proximity sensor (its input supply range is 6 to 36V and the signal pin to output the same amount of voltage which we ...
  • 31
6 votes
2 answers
3k views

Error installing RPi.GPIO in virtual environment

I am trying to create a virtual environment that can access GPIO pins. In order to do that, I need access to RPi.GPIO in the environment. I am unable to install that into the virtual environment. I ...
  • 165
1 vote
0 answers
180 views

MCP23008 Python Input Handler

How do I declare a Python callback handler method on a MCP23008 input pin? This Adafruit tutorial, which uses CircuitPython shows how to read input from the extended GPIO pin on the MCP23008, but does ...
  • 111
1 vote
1 answer
979 views

Bullseye python2 RPi.GPIO

As I read from forums, Python2 is removal at bullseye. I install python2.7 manually but there is gpio problem with python2. sudo python2.7 -m pip install RPi.GPIO dont work. Raises collect2: error: ...
1 vote
1 answer
125 views

Raspberry PI GPIO protection

I'm designing a PCB to mount and interact with a raspberry pi4. One of the things I need it to do is drive a 24V relay. This circuit has worked great with some controllers I've used where the outputs ...
-2 votes
1 answer
93 views

GPIO Runtime Error with cron script at reboot

On my Pi I am using cron to run a shell script, which in turn runs a python script on startup using the @reboot flag. This python script sets up a GPIO pin to listen for a button push, and for some ...
  • 107
0 votes
2 answers
79 views

MG 996R Servo only works in one direction with pi 4b

I have an MG 996R Servo from DM DIY More hooked up to physical pin 18 of my raspberry pi 4b running python 2.7.16 with GCC 8.3.0 on Linux2. I am powering the servo with an external 5V supply capable ...
-1 votes
2 answers
255 views

Checking which GPIO pin is high

In my program, I have 10 push buttons In a certain function of my program, I need to check if a particular push button is pressed. If it is pressed, function A should be called, while if any other ...
  • 143
0 votes
1 answer
95 views

RPi.GPIO library limitation - add_event_detect cache

How many callback events is cached in add_event_detect function? In my example below start_thread is executed just twice, but it is fired up five times (by the loop). To me it looks, that GPIO library ...
-1 votes
2 answers
1k views

Raspberry pi 4 gpio pins not working

My Raspberry pi 4 gpio pins are not working for some reason I tried uninstalling and reinstalling rpi.gpio and gpio and it did not work here is the code import RPI.GPIO as GPIO import time led = 26 ...
1 vote
1 answer
25 views

PWM transducer won't update frequency

I'm creating a simple script that outputs a text input to morse with an LED and a transducer via the GPIO pins on a Raspberry Pi 4 Model B. I tried to add input functionality with buttons that can ...
0 votes
0 answers
173 views

Using same GPIO pins simultaneously from two Python scripts using RPi.GPIO

I have two different scripts. One is a Kivy app and another is a MQTT client script that subscribes to topics received from a web server. The same hardware connected to the GPIO pins can be used from ...
-1 votes
1 answer
217 views

dtoverlay=gpio-shutdown,gpio_pull=off

I was wondering if utilizing the code below would be sufficient in shutting down and restarting a Raspberry Pi 3 A+ with the use of a TTP223 capacitive touch sensor. By default, the touch sensor is ...
  • 1
1 vote
2 answers
130 views

Relay no longer works on GPIO ports

I'm french excuse me for my english language, i works on a industrial vision processing device. I use the following components : Picaméra Raspberry Pi 3B + Relay : SRD-05VDC-SL-C I work on a python ...
  • 11
0 votes
1 answer
212 views

Receiving noise signal on input pin after connecting jumper wire to GPIO pin Raspberry pi 4

I am trying to use GPIO pin to get input from the sensonr, after connecting the sensor I noticed I have a lot of noise ( fluctuating signals between 0 and one). After further troubleshooting I noticed ...
0 votes
1 answer
608 views

How fast are C & Python libraries

I ran some code to monitor Pi hysteresis which involved mirroring a GPIO input to output. I was surprised as how slow the code was, so wrote a C version. Although this was slightly better it was still ...
  • 56.2k
0 votes
1 answer
198 views

Hardcode RF Codes - RPi-RF

I would like to use the rpi-rf module https://pypi.org/project/rpi-rf/ for a remote control alert system, using a PIR motion sensor as the input. I have so far set up the PIR input and send and ...
1 vote
2 answers
537 views

Controlling WS2812b LED strip produces inconsistent and uncontrollable output

Background I'm trying to control a single WS2812b LED strip from a Raspberry Pi. I've followed this tutorial from raspberrypi.com (with the exception of Prep & Installation step 4, because I ...
  • 131

1
2 3 4 5
15