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.

For more information see the rpio.gpio homepage.

Please Note!

If you are not aware, there are a number of different pieces of software that serve a similar fundamental purpose (controlling the Raspberry Pi GPIO pins) and are independent of one another. Not surprisingly, they also all use spins on combining "rpi" and "gpio" in their name. Each has a separate tag and questions about their use should use that specific tag. This is documented here to prevent confusion.

  • The page you are on now is for the RPi.GPIO module for python: Tag
  • The pigpio library, written in C but with ports to python and other languages: Tag
  • The pi-gpio library, for node.js (javascript): Tag

This isn't intented as an exhaustive list of such software, just the three most prone to confusion here due to the similar names perhaps made more similiar by restrictions on tag labels (all lower case, etc).

720 questions
6
votes
2 answers

Will the GPIO return data that is accurate out to .001 seconds?

Does anyone know how close I can measure time I would like to measure an event accurately to the thousands of a second?
Spencer
  • 187
  • 1
  • 2
  • 5
5
votes
4 answers

How do I make a device tree overlay for just a single GPIO?

How do I make a device tree overlay which turns GPIO 7 on my Raspberry Pi Rev 2 Model B to a HIGH OUTPUT pin? EDIT: I require the pin to be this way as early as possible. That is why I am thinking of DT overlays. Setting the pin when the operating…
mcsilvio
  • 153
  • 1
  • 1
  • 4
5
votes
2 answers

Is there documentation for RPi.GPIO

Is there documentation for RPi.GPIO? I have searched the web and can't find anything. I know I can use pydoc or help() but this produces the following:- wait_for_edge(...) Wait for an edge. Returns the channel number or None on timeout. …
Milliways
  • 59,890
  • 31
  • 101
  • 209
4
votes
5 answers

PiFM not working for me

I followed the steps found here & consulted this site. But I just get complete silence on 100.1 or other frequencies. No sound at all. Please tell me what it means. I really want to see & use my Pi as an FM transmitter.
jonny789
  • 211
  • 1
  • 5
  • 11
3
votes
1 answer

3.3 V and 5 V pins shorted — is the Pi dead?

I am new to Pi development now while working suddenly the cable wires of pin1 (3.3 V) and pin2 (5 V) got in contact for a short time then the Pi shutdown. When I turn it back on, only the LED red is on. The green LED is not, nor is the ACT LED. I…
Snow Angel
  • 103
  • 1
  • 3
  • 7
3
votes
1 answer

Attaching /Detaching interrupt in C Programming

How do I attach/detach interrupts in C language. I am currently working with GPIO Pins of Raspberry Pi and want to convert statements which I used for arduino: attachInterrupt(); detachInterrupt(Pin_no); to C language commands. I read about one of…
user8080
  • 31
  • 1
  • 2
2
votes
2 answers

More Digital Inputs

I am working on a project where I need 50 Digital Input/Outputs. Each one of the 25 of the Digital Inputs will be connected to a small piece of metal, triggered by Capacitive Touch with a finger and thus a different audio sound (note) to play, the…
2
votes
1 answer

error installing RPi.GPIO on Python

I am trying this out for the first time with not much success I recently bought latest Raspberry PI 3 B+ I am trying to install RPi.GPIO via python 3.7 on my windows 10 machine. I have successfully downloaded RPi.GPIO-0.6.3 when I run the install in…
tashmobird
  • 23
  • 1
  • 1
  • 3
2
votes
2 answers

PWM Controlled 12V Fan with dc-dc converter

I got my RPI3 cooled by a 5v dc fan and it only activates when it reaches 55°C so everything is fine i control it with PWM. Now i want to cool it with a bigger 12V DC fan the problem is i need 12V, either from external source or from the PI itself…
Corn
  • 23
  • 1
  • 5
2
votes
1 answer

Difference between GPIO.HIGH and True (or 1)

I've been tinkering around with a Raspberry Pi 2. I was working on a bike light project where I had to 'Pulse' all LEDs at the same time. I managed to get it done and working but, I struggled over the weekend to figure it out and when I did, the…
rootSU10100
  • 23
  • 1
  • 3
2
votes
1 answer

How do I get Python to recognize that it is running on a Raspberry Pi

I just purchased a Pi 2, and every time I use import RPi.GPIO in Python it returns an error that says RPi.GPIO can only be run on a Raspberry Pi, but I am running it on a Pi. I tried apt-get update and apt-get upgrade, but it still doesn't…
Geoff
  • 29
  • 1
1
vote
1 answer

I would like to switch on the Raspberry GPIO using an NPN transistor (2n2222)

Hello guys I am currently working on a project. and I would like to turn on a GPIO pin when my LED on the circuit below turns on. I'm lost to where I should tie my input GPIO pin. please help. Thanks!
Rikku
  • 19
  • 4
1
vote
2 answers

4x4 Matrix Keypad code in C

i am having a very hard time finding a purely C program for the Raspberry Pi and the 4x4 membrane matrix keypad. i can find python, c#, stamp, c++ and a couple java. however, C is completely missing from my 1/2 day's worth of google'ing. any help…
Mike Kangas
  • 49
  • 1
  • 5
1
vote
3 answers

No module named 'RPi.GPIO'

I looked everywhere for answers and non worked, hopefully i will have someone who can help me, simply I want to turn on and turn off a led and I have this code > import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # set board mode to Broadcom…
Shawn Alvandi
  • 27
  • 1
  • 1
  • 4
1
vote
2 answers

RF Module input is random

I have a attached a RF Transceiver to GPIO 24 and a receiver to GPIO 26. I setup a program: import RPi.GPIO as GPIO # to use Raspberry Pi board pin numbers GPIO.setmode(GPIO.BOARD) # set up the GPIO channels - one input and one…
Trent
  • 11
  • 3
1
2 3 4