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.

131 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
1k views

GPIO callbacks throw segmentation fault

I am using callbacks to sense obstacles in a small robot. A left sensor and a right sensor. Therefore I add an event twice. Now when the callback is called I remove the event and then later add it ...
0
votes
3answers
6k views

Error installing RPI.gpio

I'm a new enthusiast trying to learn with raspberry pi so I apologize if I don't use the correct programming terms... The problem that i'm having at the moment is that when I try pip install rpi-gpio ...
0
votes
0answers
1k views

Failing to turn on a LED with GPIO Pins (Raspberry Pi 3 B V1.2)

I'm trying to play around with my RaspberryPi a bit and I'm failing miserably... ANY help ist highly appreciated! I'm on a brand new installation of Raspbian, after "apt-get update && apt-get ...
0
votes
0answers
288 views

ESC PWM Duty Cycle between 20 - 70

I've wired my ESC and my Motor and I'm able to spin it at different speeds, but it only works between 20 - 70 DutyCycle. How can I make it start spinning at 1 and max throttle at 100? I'm using ...
0
votes
0answers
265 views

Playing audio mess with GPIO.add_event_detect in Python

I have these lines of code running in Python on my Pi 3: os.system('mpg123 -q /usr/local/marbik/public/evilcave.mp3 &') GPIO.add_event_detect(17, GPIO.FALLING, callback=GPIO17Callback, bouncetime=...
0
votes
0answers
120 views

GPIO pin being set to input upon exiting program

I have this code: import RPi.GPIO as GPIO import time try: GPIO.setmode(GPIO.BOARD) GPIO.setup(3, GPIO.OUT) GPIO.setup(12, GPIO.OUT) GPIO.output(...
0
votes
0answers
302 views

RPi.GPIO is never reachable after upgrade to Python3

yesterday I run an install of Python3 on my Raspberry Pi 3. The preinstalled Python version was 2.7.1 If I run a scrip now, i reveive the following error message: import RPi.GPIO Traceback (most ...
0
votes
0answers
205 views

Unable to set GPIO.HIGH. GPIO.LOW

I am trying to control a relay with Pi3B. Whenever I run GPIO.setup(port, GPIO.OUT) my relay starts working, then any other command I try, eg. GPIO.output(port, GPIO.HIGH) or GPIO.output(port, GPIO....
0
votes
0answers
28 views

HDMI output is off once I connected my pi to an oscillscope

I connected the +5v and gnd of my raspberry pi to an oscilloscope. Once I did that, my screen gave me a blank screen as if it is not getting any output from HDMI of raspberry pi. I turned off/on the ...
0
votes
0answers
101 views

PIR sensor GPIO

[CIrcuit1By default PIR input pin(middle) is HIGH. When i run the below code, gp.input(27) always gives me value 1. My code: import RPi.GPIO as gp import time gp.setmode(gp.BCM) gp.setup(2, gp.OUT) ...
0
votes
2answers
504 views

RPi.GPIO not working at all

I have just started with the GPIO on my raspberry pi but can't get any of the code to work. import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(18,GPIO.OUT) ...
0
votes
0answers
217 views

Why after adding GPIO.cleanup to my code it still show the GPIO channel warning?

I wrote some python to blink a led. Without the GPIO.cleanup method, I had the following warning: "This channel is already in use, continuing anyway". Then I did tempo=1 import RPi.GPIO as GPIO ...
0
votes
1answer
1k views

Wiegand GPIO read not working all the time. Works most times but hangs on some reads

I'm extremely new to Python, I've been learning a bit over the last couple weeks. This is what I've managed to come up with. I'm pretty over the moon the code works most of the time but it doesnt work ...
0
votes
0answers
93 views

Fully Bit-Banged SPI

I would like to be able to run SPI over whatever GPIO pins are available on my Pi (2 and Zero mainly). Is there any decent full code example for SPI Read/Write using RPi.GPIO on arbitrary pins? Speed ...
0
votes
0answers
3k views

How to use two HC-SR04 Ultrasonic sensor modules with Raspberry Pi

I am doing a project with raspberry pi. In it, i use two ultrasonic sensors and two buzzers. When one sensor finds an obstacle, within 50 - 450cm range sensor will beep and print the distance to the ...
0
votes
0answers
2k views

PIL Module not found even though it is installed

I am able to run a program normally from the python IDLE, but unable to run the program as a sudo. (I need to work with the GPIOs, so I require to use sudo.) I get a error, that the PIL module is not ...
0
votes
0answers
690 views

Raspberry Pi Frequency Calculator

I'm trying to make a simple program that calculates the frequency at a pin on the board. I'm using Python for the programming. I wrote two different programs and they gave the same (wrong!) results. I ...
0
votes
1answer
691 views

Controlling High voltage devices with Raspberry Pi

Can I control high voltage (here 5V) to power a led lamp and a fan(both operating at 5v) from Raspberry Pi GPIO only using a transistor . Or should I isolate both the circuits using a relay or octo-...
0
votes
1answer
148 views

Weird behavior of Raspberry Pi GPIO ports

I am trying to manipulate the GPIO pins using python. I have used many examples from the web. However, I noticed weird behavior of GPIO ports. 1) If I make a port high, it becomes high momentarily ...
0
votes
1answer
62 views

Is there a piece of hardware which enables hotplugging sensors to the breadboard?

The idea is the following: I have a Raspberry PI connected to a breadboard. To this breadboard, I would like to connect (digital and analog) sensors and actuators while the PI is running. Or remove ...
0
votes
1answer
342 views

Why is my GPIO not switching my attached relay?

I have a relay attached to a Raspberry Pi B+ GPIO via two wires, one wire is attached to physical pin 6, a ground pin, the other is attached to physical pin 15 (GPIO. 3, BCM 22, wPi 3). I have a 2 ...
-1
votes
1answer
583 views

Module not found Error

I am working on rasberry3 pi b+ model for my project and I did installed NOOBS zip file and stored in Micro SD card and put in SD slot on Rasberry Pi b+. When i'm compiling my python code for my ...
-1
votes
1answer
189 views

Modifying input of HID via GPIO of PI (unless there is a better way?)

Basically I want to control the input of a USB HID via one or more other HIDs. I know there are commercial options available to do this however they are closed source and expensive. I'd like to get ...
-1
votes
1answer
900 views

GPIO pins always set to high

I have many pins on my raspberry pi GPIO constantly set to high, and I can't seem to set them to low, even after GPIO.cleanup(). Is my Pi faulty? Some seem to be set to low, and I can't set them to ...
-1
votes
2answers
846 views

Why is my script running twice when i autostart through .bashrc?

I'm sure this has been answered before but I can't seem to find the solution that works. I am running the latest Raspbian on an RPi 3. I created a bash script named "loop.sh" that loops through two ...
-1
votes
2answers
179 views

Traditional Light Switch Triggered by RPi?

Does anyone know of a light switch which can be controlled using the RPi and also manually. Assuming that the RPi sends a signal thru a relay which connects to the light switch. The switch will turn ...
-1
votes
1answer
189 views

GPIO modes without breaking serial

I am using and Adafruit BNO055 IMU and using their provided modules to read the data, i have been able to do so. However i want to be able to turn some of the GPIO pins to high as i want to control ...
-1
votes
1answer
365 views

webiopi simple 3 wheeled robot, not functioning

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; ...
-1
votes
1answer
3k views

Touch functionality on 3.5" LCD Touchscreen not working

I have loaded the Raspbian image onto my LCD Touchscreen for the Rasp Pi. However, the touch facility does not work. The display is there but no touch. Can anyone help? I am using the Waveshare 3.5" ...
-1
votes
2answers
383 views

RPIO Module installation

I've been trying to install the RPIO module onto my pi. so far, no luck because my pi is without internet at the moment (I only have internet on my laptop through mobile tethering). Does anybody know ...
-2
votes
1answer
22 views

How do I connect my 24 pin fpc to dip breakout board to my rpi zero w?

So I am working on a type of headset and I bought the adafruit 1.3 ips with 24 pin fpc connector and st7789 driver and I'm thinking of using a breakout board to do it. What I don't know is the pin out ...

1 2
3