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).

713 questions
171
votes
1 answer

What is the difference between BOARD and BCM for GPIO pin numbering?

When using the RPi.GPIO library in Python you have to call import RPi.GPIO as GPIO and then GPIO.setmode(GPIO.BOARD) or GPIO.setmode(GPIO.BCM) What is the difference between these two options?
mirams
  • 3,868
  • 4
  • 16
  • 22
52
votes
4 answers

Can I use Raspberry Pi in commercial production?

I'm quite new to Raspberry Pi. I recently started hacking my new RPI with raspbian and working on a video streaming project. I finished my prototype and things are ready for production. RPI is awesome no doubt about, but can I use it for production…
Evan Lévesque
  • 899
  • 1
  • 7
  • 11
24
votes
7 answers

Getting more than 26 GPIO pins

I would like to be able to output 75 digital out signals from the Raspberry Pi. However it has only 26 GPIO pins. Precise timing is not critical as long as it is within 1 second. I need to be able to turn all the signals on or off at the same…
Scoop
  • 2,681
  • 7
  • 27
  • 25
22
votes
5 answers

How to correctly install the python RPi.GPIO library

I downloaded RPi.GPIO 5.3a from here: https://pypi.python.org/pypi/RPi.GPIO I extracted the tar file, cd into the folder and ran: sudo python setup.py install It ran through a bunch of stuff and doesn't seem to have failed. The last line of its…
FoamyGuy
  • 429
  • 1
  • 5
  • 10
22
votes
3 answers

Why are some GPIO pins HIGH when the Raspberry Pi boots up?

I have an easy circuit wired up, with an LED connected to pin 18 on the BOARD reference. I run a simple program to put pin 18 to HIGH, which turns the LED on, and then a couple of seconds later, I set pin 18 to LOW, and finally I end my program with…
Viktor Raspberry
  • 415
  • 2
  • 4
  • 8
17
votes
3 answers

GPIO: Warning Channel already in use

gpio.py:5: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings. GPIO.setup(8, GPIO.OUT) That is what I get after I run: import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(7,…
LilVinny
  • 420
  • 1
  • 4
  • 16
17
votes
2 answers

What hardware do I need to turn Raspberry Pi into a TV remote controller?

I would like to control my TV using a Raspberry Pi. I would like my Raspberry Pi to act like a TV remote controller. What kind of hardware do I need to make it? Do I need something like IR emitter, and if so, where to buy such hardware? …or does the…
Ashbay
  • 373
  • 1
  • 2
  • 9
17
votes
4 answers

How can I use more GPIO ports on the Raspberry Pi?

I am currently planning a project for a course at school which involves using the Raspberry Pi - however I'm worried that I will not have enough GPIO connectors for the inputs and outputs that I will need for the project. What could I use to allow…
ChaoticPanda
  • 395
  • 2
  • 3
  • 7
14
votes
4 answers

How to include RPi.GPIO in a python CGI script with lighttpd?

I've recently setup python to work with lighttpd via CGI (see here). But the minute I go to include RPi.GPIO, the script stops executing (I'm assuming because no HTML gets output), but there is no error output into the error log…
Mark Ingram
  • 879
  • 3
  • 11
  • 18
12
votes
5 answers

Can I read the amount of light?

I'm not sure how to say it, but I would like to read the 'amount of light' with my Raspberry Pi. By the 'amount of light' I mean a number between 0 and 100 (for instance) where 0 is no light/dark and 100 is lots of light (which is, as I understand,…
Michel
  • 1,124
  • 4
  • 14
  • 21
12
votes
2 answers

Controlling many LEDs with few GPIO pins

I successfully completed my hardware "hello world" using this guide: http://www.raspberrypi-spy.co.uk/2012/06/control-led-using-gpio-output-pin/ Now I'd like to move on to bigger and brighter things, more individually controlled LEDs that is!…
SkyNT
  • 223
  • 1
  • 2
  • 6
11
votes
3 answers

How fast can GPIO pins toggle?

I'm currently using Python's RPi.GPIO module to toggle some pins, and I want to know how quickly it can do this. I need the pins to be toggled on the schedule of a ~50 mhz FPGA clock, which I'm worried is too fast for the Pi (I need 8 pins toggled).…
Auden Young
  • 233
  • 1
  • 2
  • 10
11
votes
1 answer

Using additional GPIOs as digital I/O?

hopefully this question is rather simple but my quick googling did not find the answer. I know that the RPi has several GPIOs that I can use as well as specialized GPIOs (SPI, I2C, UART, etc). In my project I am actually running out of the regular…
11
votes
5 answers

How to connect a graphic card to Raspberry pi?

I want a way to connect a graphic card like nvidia or amd to raspberry pi do you think has a way to do that?
kiumars khaleghi
  • 125
  • 1
  • 1
  • 7
11
votes
2 answers

Where are the uarts on the raspberry pi 4?

The raspberry pi 4 has at least two uarts (as shown here), I know where I can connect to one of them. Pins 8, 10 and 12 have a uart as an option. Source: This site describes accessing uart1, where is it? Do I have access to it?
Voltage Spike
  • 214
  • 1
  • 2
  • 10
1
2 3
47 48