Name Date Size

..29-Nov-20194 KiB

.github/H23-Sep-20194 KiB

.gitignoreH A D15-Jul-2019233

.travis.ymlH A D17-Sep-2019582

copyrightsH A D15-Jul-20196.9 KiB

coverage.cfgH A D15-Jul-2019299

debian/H17-Sep-20194 KiB

docs/H06-Jan-20204 KiB

gpiozero/H20-Jan-20204 KiB

gpiozerocli/H15-Jul-20194 KiB

LICENSE.rstH A D15-Jul-20191.4 KiB

MakefileH A D15-Jul-20195.4 KiB

MANIFEST.inH A D15-Jul-201968

README.rstH A D19-Jan-20206.6 KiB

RELEASE.rstH A D23-Sep-20191.7 KiB

setup.pyH A D17-Sep-20194.7 KiB

tests/H26-Sep-20194 KiB

tox.iniH A D15-Jul-20191.8 KiB

README.rst

1========
2gpiozero
3========
4
5.. image:: https://badge.fury.io/py/gpiozero.svg
6    :target: https://badge.fury.io/py/gpiozero
7    :alt: Latest Version
8
9.. image:: https://travis-ci.org/gpiozero/gpiozero.svg?branch=master
10    :target: https://travis-ci.org/gpiozero/gpiozero
11    :alt: Build Tests
12
13.. image:: https://img.shields.io/codecov/c/github/gpiozero/gpiozero/master.svg?maxAge=2592000
14    :target: https://codecov.io/github/gpiozero/gpiozero
15    :alt: Code Coverage
16
17A simple interface to GPIO devices with Raspberry Pi.
18
19Created by `Ben Nuttall`_ of the `Raspberry Pi Foundation`_, `Dave Jones`_, and
20other contributors.
21
22.. _Ben Nuttall: https://github.com/bennuttall
23.. _Raspberry Pi Foundation: https://www.raspberrypi.org/
24.. _Dave Jones: https://github.com/waveform80
25
26About
27=====
28
29Component interfaces are provided to allow a frictionless way to get started
30with physical computing:
31
32.. code:: python
33
34    from gpiozero import LED
35    from time import sleep
36
37    led = LED(17)
38
39    while True:
40        led.on()
41        sleep(1)
42        led.off()
43        sleep(1)
44
45With very little code, you can quickly get going connecting your components
46together:
47
48.. code:: python
49
50    from gpiozero import LED, Button
51    from signal import pause
52
53    led = LED(17)
54    button = Button(3)
55
56    button.when_pressed = led.on
57    button.when_released = led.off
58
59    pause()
60
61You can advance to using the declarative paradigm along with provided
62to describe the behaviour of devices and their interactions:
63
64.. code:: python
65
66    from gpiozero import LED, MotionSensor, LightSensor
67    from gpiozero.tools import booleanized, all_values
68    from signal import pause
69
70    garden = LED(17)
71    motion = MotionSensor(4)
72    light = LightSensor(5)
73
74    garden.source = all_values(booleanized(light, 0, 0.1), motion)
75
76    pause()
77
78See the chapter on `Source/Values`_ for more information.
79
80.. _Source/Values: https://gpiozero.readthedocs.io/en/stable/source_values.html
81
82The library includes interfaces to many simple everyday components, as well as
83some more complex things like sensors, analogue-to-digital converters, full
84colour LEDs, robotics kits and more. See the `Recipes`_ chapter of the
85documentation for ideas on how to get started.
86
87.. _Recipes: https://gpiozero.readthedocs.io/en/stable/recipes.html
88
89Pin factories
90=============
91
92GPIO Zero builds on a number of underlying pin libraries, including `RPi.GPIO`_
93and `pigpio`_, each with their own benefits. You can select a particular pin
94library to be used, either for the whole script or per-device, according to your
95needs. See the section on `changing the pin factory`_.
96
97.. _RPi.GPIO: https://pypi.org/project/RPi.GPIO
98.. _pigpio: https://pypi.org/project/pigpio
99.. _changing the pin factory: https://gpiozero.readthedocs.io/en/stable/api_pins.html#changing-the-pin-factory
100
101A "mock pin" interface is also provided for testing purposes. Read more about
102this in the section on `mock pins`_.
103
104.. _mock pins: https://gpiozero.readthedocs.io/en/stable/api_pins.html#mock-pins
105
106Installation
107============
108
109GPIO Zero is installed by default in the Raspbian desktop image, available from
110`raspberrypi.org`_. To install on Raspbian Lite or other operating systems,
111including for PCs using remote GPIO, see the `Installing`_ chapter.
112
113.. _raspberrypi.org: https://www.raspberrypi.org/downloads/
114.. _Installing: https://gpiozero.readthedocs.io/en/stable/installing.html
115
116Documentation
117=============
118
119Comprehensive documentation is available at https://gpiozero.readthedocs.io/.
120Please refer to the `Contributing`_ and `Development`_ chapters in the
121documentation for information on contributing to the project.
122
123.. _Contributing: https://gpiozero.readthedocs.io/en/stable/contributing.html
124.. _Development: https://gpiozero.readthedocs.io/en/stable/development.html
125
126Contributors
127============
128
129Core developers:
130
131- `Ben Nuttall`_
132- `Dave Jones`_
133- `Andrew Scheller`_
134
135Other contributors:
136
137- `Alex Chan`_
138- `Alex Eames`_
139- `Barry Byford`_
140- `Carl Monk`_
141- `Claire Pollard`_
142- `Clare Macrae`_
143- `David Glaude`_
144- `Daniele Procida`_
145- `Delcio Torres`_
146- `Edward Betts`_
147- `Fatih Sarhan`_
148- `Ian Harcombe`_
149- `Jeevan M R`_
150- `Mahallon`_
151- `Maksim Levental`_
152- `Martchus`_
153- `Martin O'Hanlon`_
154- `Mike Kazantsev`_
155- `Phil Howard`_
156- `Philippe Muller`_
157- `Rick Ansell`_
158- `Russel Winder`_
159- `Schelto van Doorn`_
160- `Sofiia Kosovan`_
161- `Steve Amor`_
162- `Stewart Adcock`_
163- `Thijs Triemstra`_
164- `Tim Golden`_
165- `Yisrael Dov Lebow`_
166
167
168.. _Alex Chan: https://github.com/gpiozero/gpiozero/commits?author=alexwlchan
169.. _Alex Eames: https://github.com/gpiozero/gpiozero/commits?author=raspitv
170.. _Andrew Scheller: https://github.com/gpiozero/gpiozero/commits?author=lurch
171.. _Barry Byford: https://github.com/gpiozero/gpiozero/commits?author=ukBaz
172.. _Carl Monk: https://github.com/gpiozero/gpiozero/commits?author=ForToffee
173.. _Claire Pollard: https://github.com/gpiozero/gpiozero/commits?author=tuftii
174.. _Clare Macrae: https://github.com/gpiozero/gpiozero/commits?author=claremacrae
175.. _David Glaude: https://github.com/gpiozero/gpiozero/commits?author=dglaude
176.. _Daniele Procida: https://github.com/evildmp
177.. _Delcio Torres: https://github.com/gpiozero/gpiozero/commits?author=delciotorres
178.. _Edward Betts: https://github.com/gpiozero/gpiozero/commits?author=edwardbetts
179.. _Fatih Sarhan: https://github.com/gpiozero/gpiozero/commits?author=f9n
180.. _Ian Harcombe: https://github.com/gpiozero/gpiozero/commits?author=MrHarcombe
181.. _Jeevan M R: https://github.com/gpiozero/gpiozero/commits?author=jee1mr
182.. _Mahallon: https://github.com/gpiozero/gpiozero/commits?author=Mahallon
183.. _Maksim Levental: https://github.com/gpiozero/gpiozero/commits?author=makslevental
184.. _Martchus: https://github.com/gpiozero/gpiozero/commits?author=Martchus
185.. _Martin O'Hanlon: https://github.com/martinohanlon
186.. _Mike Kazantsev: https://github.com/gpiozero/gpiozero/commits?author=mk-fg
187.. _Phil Howard: https://github.com/gpiozero/gpiozero/commits?author=Gadgetoid
188.. _Philippe Muller: https://github.com/gpiozero/gpiozero/commits?author=pmuller
189.. _Rick Ansell: https://github.com/gpiozero/gpiozero/commits?author=ricksbt
190.. _Russel Winder: https://github.com/russel
191.. _Schelto van Doorn: https://github.com/gpiozero/gpiozero/commits?author=goloplo
192.. _Sofiia Kosovan: https://github.com/gpiozero/gpiozero/commits?author=SofiiaKosovan
193.. _Steve Amor: https://github.com/gpiozero/gpiozero/commits?author=SteveAmor
194.. _Stewart Adcock: https://github.com/gpiozero/gpiozero/commits?author=stewartadcock
195.. _Thijs Triemstra: https://github.com/gpiozero/gpiozero/commits?author=thijstriemstra
196.. _Tim Golden: https://github.com/gpiozero/gpiozero/commits?author=tjguk
197.. _Yisrael Dov Lebow: https://github.com/gpiozero/gpiozero/commits?author=yisraeldov
198