skip to navigation
skip to content

RPi.GPIO 0.3.1a

A module to control Raspberry Pi GPIO channels

Latest Version: 0.5.11

This package provides a class to control the GPIO on a Raspberry Pi.

Note that this module is unsuitable for real-time or timing critical applications. This is because you
can not predict when Python will be busy garbage collecting. It also runs under the Linux kernel which
is not suitable for real time applications - it is multitasking O/S and another process may be given
priority over the CPU, causing jitter in your program. If you are after true real-time performance and
predictability, buy yourself an Arduino !

Note that the current release does not support SPI, I2C, PWM or serial functionality on the RPi yet.
This is planned for the near future - watch this space! One-wire functionality is also planned.

Example Usage :


import RPi.GPIO as GPIO

# to use Raspberry Pi board pin numbers

# set up GPIO output channel
GPIO.setup(12, GPIO.OUT)

# set RPi board pin 12 high
GPIO.output(12, GPIO.HIGH)

# set up GPIO input with pull-up control
# (pull_up_down be PUD_OFF, PUD_UP or PUD_DOWN, default PUD_OFF)
GPIO.setup(11, GPIO.IN, pull_up_down=GPIO.PUD_UP)

# input from RPi board pin 11
input_value = GPIO.input(11)

# to change to BCM GPIO numbering
Change Log
- Fixed critical bug with swapped high/low state on outputs
- Added pull-up / pull-down setup functionality for inputs

- Rewritten as a C extension
- Now uses /dev/mem and SoC registers instead of /sys/class/gpio
- Faster!
- Make call to GPIO.setmode() mandatory
- Added GPIO.HIGH and GPIO.LOW constants

- Changed status from alpha to beta
- Added setmode() to be able to use BCM GPIO 00.nn channel numbers
- Renamed InvalidPinException to InvalidChannelException

- Fixed direction bug
- Added (to include missing file)
- Changed GPIO channel number to pin number
- Tested and working!

- Added GPIO table
- Refactored
- Fixed a few critical bugs
- Still completely untested!

- Internal refactoring. Still completely untested!

- First version. Completely untested until I can get hold of a Raspberry Pi!  
File Type Py Version Uploaded on Size
RPi.GPIO-0.3.1a.tar.gz (md5) Source 2012-09-21 10KB
  • Downloads (All Versions):
  • 351 downloads in the last day
  • 2579 downloads in the last week
  • 11377 downloads in the last month