@@ -58,13 +58,48 @@ together:
58
58
59
59
pause()
60
60
61
+ You can advance to using the declarative paradigm along with provided
62
+ :doc: `source tools <api_tools >` to describe the behaviour of devices and their
63
+ interactions:
64
+
65
+ .. code :: python
66
+
67
+ from gpiozero import LED , MotionSensor, LightSensor
68
+ from gpiozero.tools import booleanized, all_values
69
+ from signal import pause
70
+
71
+ garden = LED(17 )
72
+ motion = MotionSensor(4 )
73
+ light = LightSensor(5 )
74
+
75
+ garden.source = all_values(booleanized(light, 0 , 0.1 ), motion)
76
+
77
+ pause()
78
+
79
+ See the chapter on :doc: `Source/Values <source_values >` for more information.
80
+
61
81
The library includes interfaces to many simple everyday components, as well as
62
82
some more complex things like sensors, analogue-to-digital converters, full
63
83
colour LEDs, robotics kits and more. See the `Recipes `_ chapter of the
64
84
documentation for ideas on how to get started.
65
85
66
86
.. _Recipes : https://gpiozero.readthedocs.io/en/stable/recipes.html
67
87
88
+ Pin factories
89
+ =============
90
+
91
+ GPIO Zero builds on a number of underlying pin libraries, including `RPi.GPIO `_
92
+ and `pigpio `_, each with their own benefits. You can select a particular pin
93
+ library to be used, either for the whole script or per-device, according to your
94
+ needs. See the section on :ref: `changing the pin factory
95
+ <changing-pin-factory>`.
96
+
97
+ .. _RPi.GPIO : https://pypi.org/project/RPi.GPIO/
98
+ .. _pigpio : https://pypi.org/project/pigpio
99
+
100
+ A "mock pin" interface is also provided for testing purposes. Read more about
101
+ this in the section on :ref: `mock pins <mock-pins >`.
102
+
68
103
Installation
69
104
============
70
105
0 commit comments