New GPIO wrapper library for the Raspberry Pi

Ben Nuttall has been working hard to create a library which will provide a simpler interface to the GPIO pins. The library is called GPIO Zero. At the moment, on the RPi.GPIO library, there are a couple of commands to set things like the pin numbering system that kids are often told to just “enter and forget about”. This library obfuscates these commands to simplify matters. An example is shown below:

from gpiozero import LED
red = LED(2)
red.on()

Ben has built in several add-on boards so far and aims to make it the easiest way to program the GPIO in Python on the Pi. It’s actually a wrapper for the good old RPi.GPIO library, so existing code will still work the same way. You can read documentation and more information on PythonHosted.org as well as instructions on how to install it. Please bear in mind this is a beta so your mileage may vary!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.