GPIO Zero - a new Python library designed for education - Raspberry Pi Forums


[cross-posted education sub-forum]

i've been working on new python library provides simple interface everyday gpio components. sits on top of standard rpi.gpio requires less code 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'm aiming minimal boilerplate (no setmode, setwarnings), easy read, guessable , obvious.

i've released public beta , plan full release within month. i'd feedback, particularly teachers, language of interface right (function names , such), , @ simple , complex examples see if it's achieving goals.

install on 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 
library supports python 3 , python 2. python 3 recommended!

open idle or python shell, import bits you're using , going. full documentation available @ http://pythonhosted.org/gpiozero/

please feel free leave feedback here or in google doc: https://docs.google.com/document/d/1ebb ... edit?pli=1#

not teacher i've been stem ambassador , have taught mindstorms kids , developed arduino scratch workshop.

comment far, without running it, on following syntax

code: select all

is_active
think i'd replace with

code: select all

is_on
,

code: select all

is_off


raspberrypi



Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support