RPi.GPIO – Used in Raspberry Pi learning resources – 132k code search results on github.com • Lots of typing required for basic examples • Lots of copy/paste code when using more complicated devices like sensors • Requires fundamental understanding of electronics • Lots of use of polling • Implementation in C – exposes a non-Pythonic API
access the GPIO pins • This meant running Python files with sudo • This also meant opening IDLE from the menu did not allow GPIO access, must be opened with sudo idle & • The pi user was given access to GPIO pins in Raspbian Jessie (released during development of GPIO Zero)
APIs for Raspberry Pi Hardware • Teachers saying it's too hard to use Python • Too much code to write to flash an LED (what is this, Java?) • Too much boilerplate code needed to get started • Too many electronics concepts required to understand (or ignore) e.g. pull-up vs. pull-down, and falling/rising edge • Lots of bad code out there – all being copied
“Part of the fun is learning how it works” • “It shouldn't be this easy to blink an LED” • “You're dumbing down the flexibility of RPi.GPIO” • “It's nice but I'll still use RPi.GPIO for the complex stuff”
you get it ready for the next Raspbian release?” - Eben Upton • “It's great! I never meant for RPi.GPIO to be an end-user library anyway!” - Ben Croston
10000.0 for i in range(10000)] red = PWMLED(12) red.source = blue.values blue.source = [i / 10000.0 for i in range(10000)] sensor = LightSensor(18) blue.source = sensor.values
idea • 14 Sept – Initial commit on GitHub • 15 Sept – Named GPIO Zero, first PR, first alpha released on PyPi • 23 Sept – Mentioned in talk at PyConUK • 28 Sept – v0.6 public beta 1 • 09 Oct – v0.7 public beta 2 • 16 Oct – v0.8 public beta 3 • 25 Oct – v0.9 public beta 4 • 29 Oct – Featured in The MagPi • 16 Nov – v1.0 released • 21 Nov – Released in Raspbian Jessie
• Add test suite • Replace RPi.GPIO dependency • Promote use of “gpiozero standard” to allow other modules to provide objects which plug-in to gpiozero objects easily (e.g. source/values)
• Dave Jones is awesome (ok I already knew that) • User-focused API design is important • Getting feedback from teachers is hard • Getting code contributions is hard • Getting documentation contributions is easier