User avatar
croston
Posts: 716
Joined: Sat Nov 26, 2011 12:33 pm
Location: Blackpool
Contact: Website

Re: Python GPIO module

Mon Feb 06, 2012 7:48 pm

I have taken the liberty of creating a Python module for GPIO on R-Pi.  The project pages are at:

http://code.google.com/p/raspb.....io-python/

The module is also available on PyPi:

http://pypi.python.org/pypi/RPi.GPIO/

It is open-source under a MIT licence.

Warning: It is still pre-alpha so I might change it completely yet.  I've not been able to test because I'm waiting for a R-Pi like the rest of you!

dics
Posts: 14
Joined: Mon Feb 06, 2012 3:54 pm
Contact: Website

Re: Python GPIO module

Tue Feb 07, 2012 5:07 pm

Very useful !

Thank you

User avatar
meltwater
Posts: 1015
Joined: Tue Oct 18, 2011 11:38 am

Re: Python GPIO module

Wed Feb 08, 2012 10:21 am

Excellent!

Will follow this with interest.  Thinking a software virtual GPIO emulation would be useful for experimenting with, is that possible?
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Python GPIO module

Mon Apr 16, 2012 11:13 am

Bump for those interested, and may of finally had their Pi delivered.

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
croston
Posts: 716
Joined: Sat Nov 26, 2011 12:33 pm
Location: Blackpool
Contact: Website

Re: Python GPIO module

Mon Apr 16, 2012 12:54 pm

I have a RPi and am testing the module at the moment. I have already had to change something so there will be a new version later today.

firstplacefranz
Posts: 21
Joined: Wed Apr 18, 2012 6:25 pm

Re: Python GPIO module

Sat Apr 21, 2012 2:08 am

Have you updated the module yet? Very interested.

SteGriff
Posts: 8
Joined: Mon Nov 21, 2011 2:34 pm
Contact: Website

Re: Python GPIO module

Sat Apr 21, 2012 1:14 pm

Very nice wrapper! I skim-read your source and it looks very well done, and leads to really readable user code.

Great stuff! Consider yourself @followed.

User avatar
croston
Posts: 716
Joined: Sat Nov 26, 2011 12:33 pm
Location: Blackpool
Contact: Website

Re: Python GPIO module

Sat Apr 21, 2012 8:55 pm

The Python GPIO module has now been tested and released!

firstplacefranz
Posts: 21
Joined: Wed Apr 18, 2012 6:25 pm

Re: Python GPIO module

Sat Apr 21, 2012 9:25 pm

What is the    'RPi.GPIO as GPIO'   refering too? Where is this module?

firstplacefranz
Posts: 21
Joined: Wed Apr 18, 2012 6:25 pm

Re: Python GPIO module

Sun Apr 22, 2012 2:03 am

Whoa just playing with the GPIO's when i just caused the raspi to restart... Thank god no perminant harm done.

larsth
Posts: 55
Joined: Sat Aug 27, 2011 9:51 pm
Contact: Website

Re: Python GPIO module

Sun Apr 22, 2012 2:46 am

croston said:


The Python GPIO module has now been tested and released!



Do your Python module support the hardware GPIO intterrupts (rising edge, falling edge, positive,negative,change)?

The interesting thing about hardware GPIO interrupt support is that polling can be avoided and you application can sleep.

The program will then be avaken by the kernel if you are using asynchronous (async) I/O:

http://www.ibm.com/developerwo.....y/l-async/ (look at figure 5)

firstplacefranz
Posts: 21
Joined: Wed Apr 18, 2012 6:25 pm

Re: Python GPIO module

Sun Apr 22, 2012 3:12 am

Idk man but it works pretty well. I got my light blinking (its red... ).

You can download it here, if you want to take a look at.

http://pypi.python.org/pypi/RPi.GPIO

sironitomas
Posts: 6
Joined: Mon Apr 23, 2012 12:59 pm

Re: Python GPIO module

Mon May 28, 2012 2:44 pm

I have created a PKGBUILD for Arch Linux. If someone can test it, that would be great.

https://aur.archlinux.org/packages.php?ID=59458

Any suggestion is welcome. Regards!

Penno
Posts: 5
Joined: Wed Dec 28, 2011 4:27 pm

Re: Python GPIO module

Thu May 31, 2012 3:58 pm

hi - downloaded the module and gave it a go. Worked just fine and I've got my daughter's 'Hot Wires' electronics lab now hooked up to the Raspberry. Given I'm new to linux, Python and very rusty on electronics I'm feeling very chuffed :)

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Python GPIO module

Sun Jun 03, 2012 12:35 pm

Hi,
new to python and linux and struggling to get a LED to light up in python with this script. i can do it in the shell using the wiki guide, but in python.
I,ve posted this in the python thread :

http://www.raspberrypi.org/phpBB3/viewt ... =32&t=7370

Can anyone help with what I'm doing wrong?
Thanks,
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

Return to “Python”