I've been working on a new Python library that provides a simple interface to everyday GPIO components. It sits on top of the standard RPi.GPIO but requires much less code to get going. It's called GPIO Zero.
Simple example:
Code: Select all
from gpiozero import LED, Button
led = LED(2)
button = Button(3)
button.when_pressed = led.on
button.when_released = led.off
I've released a public beta and I plan to do a full release within a month. I'd like to get some feedback, particularly from teachers, to help get the language of the interface right (function names and such), and look at some simple and complex examples to see if it's achieving its goals.
Install it on your Pi with:
Code: Select all
sudo apt-get update
sudo apt-get install python-pip python3-pip
sudo pip install gpiozero
sudo pip-3.2 install gpiozero
Just open IDLE or a Python shell, import the bits you're using and get going. Full documentation is available at http://pythonhosted.org/gpiozero/
Please feel free to leave feedback here or in the Google Doc: https://docs.google.com/document/d/1Ebb ... edit?pli=1#