paddi2013
Posts: 24
Joined: Wed Jul 17, 2013 4:30 am

Program GPIO using python

Mon Jul 22, 2013 7:20 am

Hello everybody, i am interested in knowing how to program my pi's GPIO using python.

ive done some research and i couldnt really find any reliable information that could help me out.

does anybody know how to program the GPIO using python ? and what is the function of the library for the python GPIO ?

Please and thankyou !

User avatar
joan
Posts: 14089
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Program GPIO using python

Mon Jul 22, 2013 7:24 am

Look through http://themagpi.com for Python articles or look through some posts in the Python forum.

keybeeper
Posts: 26
Joined: Wed Aug 08, 2012 10:15 am

Re: Program GPIO using python

Mon Jul 22, 2013 9:05 am

Some of the MagPi articles using RPi.GPIO are out of date, so may not all work.

RasPi.TV has just finished an excellent 7-part series on RPi.GPIO basics. You can do no better than look here:-

http://raspi.tv/category/python-programming
No Microsoft products were used in the creation of this message

updowndown
Posts: 18
Joined: Fri Jul 19, 2013 8:49 am

Re: Program GPIO using python

Mon Jul 22, 2013 12:19 pm

For my students I made the following video to give a general overview of the GPIO pins:

http://youtu.be/wwgmgobDqms

If you're looking for a first project with them, controlling an LED is the classic "Hello World" electronics project, which you can find out how to do from:

http://youtu.be/J9cEAGTLaC8

Hope that gives you somewhere to start.
Raspberry Pi Tutorials at: www.youtube.com/user/updowndown

thsBavR10
Posts: 233
Joined: Sat Jul 21, 2012 3:11 pm

Re: Program GPIO using python

Mon Jul 22, 2013 3:56 pm

1) WiringPi (http://wiringpi.com/news/) is the
"GPIO Interface library for the Raspberry Pi" from Gordon Henderson.
2) Python-wrapped version of Gordon Henderson's WiringPi version 2:
- find source at https://github.com/Gadgetoid/WiringPi2-Python
- (http://pi.gadgetoid.com/post/039-wiring ... tra-python)

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2848
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Program GPIO using python

Wed Jul 24, 2013 11:58 am

keybeeper wrote:RasPi.TV has just finished an excellent 7-part series on RPi.GPIO basics. You can do no better than look here:-

http://raspi.tv/category/python-programming
Thanks for the mention. For the time being that link works, but as I write more blogs about Python programming, the RPi.GPIO stuff will slide down that page into obscurity.

I've actually made a permanent page with links to all 12 (so far) of my RPi.GPIO tutorials...

http://raspi.tv/rpi-gpio

Just started on WiringPi2 for python this week.
Alex Eames RasPi.TV, RasP.iO

6677
Posts: 383
Joined: Wed Mar 14, 2012 9:23 pm

Re: Program GPIO using python

Wed Jul 24, 2013 6:32 pm

paddi2013 wrote:Hello everybody, i am interested in knowing how to program my pi's GPIO using python.

ive done some research and i couldnt really find any reliable information that could help me out.

does anybody know how to program the GPIO using python ? and what is the function of the library for the python GPIO ?

Please and thankyou !
You havent searched hard enough then.

Google: "GPIO Python"

The module you need: https://pypi.python.org/pypi/RPi.GPIO I actually wont recommend going on here, will probably just confuse you
A getting started guide: http://openmicros.org/index.php/article ... and-python
Another module page: https://code.google.com/p/raspberry-gpio-python/ Again, dont go on it.
Another getting started guide: http://lwk.mjhosting.co.uk/?p=343
Another guide: http://www.thirdeyevis.com/pi-page-2.php

There we go, first 5 results in google. 3 are full tutorials. 2 are pages related to the module you need which should at least give you more search terms. Frankly if it took me less than 5 seconds to do that I hate to see what you call research.

User avatar
raspberrypiguy1
Posts: 379
Joined: Sun Sep 02, 2012 7:01 pm

Re: Program GPIO using python

Wed Jul 24, 2013 7:25 pm

I've got a few tutorials out there, here was my first episode: http://www.youtube.com/watch?v=H08BLCuhaxg

And you should be able to navigate to the other ones from there! Glad to see that it is still up to date!

The Raspberry Pi Guy
Matt, The Raspberry Pi Guy YouTube channel, author of Learn Robotics with Raspberry Pi, available now: http://mybook.to/raspirobots, Computer Science & Electronics Undergraduate at The University of Edinburgh

paddi2013
Posts: 24
Joined: Wed Jul 17, 2013 4:30 am

Re: Program GPIO using python

Mon Jul 29, 2013 7:45 am

tq so much everybody ! this really helps :D

Return to “Python”