Files
loustique-home/venv/lib/python3.11/site-packages/gpiozero/__pycache__/boards.cpython-311.pyc

2248 lines
127 KiB
Plaintext
Raw Normal View History

2026-03-21 10:53:02 +01:00
<EFBFBD>
?<3F><>i|<7C><00><00>\<00>ddlZddlmZddlmZmZmZmZddlm Z ddl
m Z m Z m Z ddlmZddlmZ ddlZn#e$r ddlmZYnwxYwd d
lmZmZmZmZmZmZmZmZd d lm Z d d l!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)d d l*m+Z+d dl,m-Z-m.Z.d dl/m0Z0m1Z1m2Z2m3Z3d dl4m5Z5m6Z6d<11>Z7Gd<12>de1e.<2E><00>Z8Gd<14>de2e.<2E><00>Z9e9j:e9_;e9j<e9_=e9j>e9_?e9j@e9_Ae9jBe9_Ce9jDe9_EGd<16>de8<65><00>ZFeFj:eF_GGd<18>deF<65><00>ZHGd<1A>deF<65><00>ZIGd<1C>de<0F><00>ZJGd<1E>deF<65><00>ZKGd <20>d!e8<65><00>ZLGd"<22>d#eH<65><00>ZMGd$<24>d%e%<25><00>ZNGd&<26>d'eH<65><00>ZOGd(<28>d)eI<65><00>ZPGd*<2A>d+eH<65><00>ZQGd,<2C>d-eQ<65><00>ZRGd.<2E>d/eQ<65><00>ZSGd0<64>d1eH<65><00>ZTGd2<64>d3e8<65><00>ZUGd4<64>d5eH<65><00>ZVGd6<64>d7e8<65><00>ZWGd8<64>d9e8<65><00>ZXGd:<3A>d;e8<65><00>ZYGd<<3C>d=eQ<65><00>ZZdRd?<3F>Z[Gd@<40>dAe1e.<2E><00>Z\GdB<64>dCe\<5C><00>Z]GdD<64>dEe\<5C><00>Z^GdF<64>dGe\<5C><00>Z_GdH<64>dIe0e8<65><00>Z`GdJ<64>dKe1e-<2D><00>ZaGdL<64>dMeH<65><00>ZbGdN<64>dOe8<65><00>ZcGdP<64>dQe8<65><00>ZddS)S<>N)<01>sleep)<04>repeat<61>cycle<6C>chain<69>tee)<01>Lock)<03> OrderedDict<63>Counter<65>
namedtuple)<01>MutableMapping)<01>pformat)<01> resources<65>)<08> DeviceClosed<65> PinInvalidPin<69>GPIOPinMissing<6E>EnergenieSocketMissing<6E>EnergenieBadSocket<65>OutputDeviceBadValue<75>CompositeDeviceBadDevice<63> BadWaitTime<6D><01>Button)<08> OutputDevice<63>LED<45>PWMLED<45>RGBLED<45>Buzzer<65>Motor<6F>PhaseEnableMotor<6F> TonalBuzzer)<01>
GPIOThread)<02>Device<63>CompositeDevice)<04> SharedMixin<69> SourceMixin<69> HoldMixin<69>event)<02>load_font_7seg<65>load_font_14segc<00>f<00>t|<00><00>\}}t|d<00><00>t||<02><00>S<00>N)r<00>next<78>zip)<03>it<69>a<>bs <20>[/home/maxime/Documents/loustiques-home/venv/lib/python3.11/site-packages/gpiozero/boards.py<70>pairwiser3=s,<00><00> <0E>r<EFBFBD>7<EFBFBD>7<EFBFBD>D<EFBFBD>A<EFBFBD>q<EFBFBD><08><11>D<EFBFBD>M<EFBFBD>M<EFBFBD>M<EFBFBD> <0E>q<EFBFBD>!<21>9<EFBFBD>9<EFBFBD><14>c<00>d<00><00>eZdZdZd<02>Zd<03>Zd<04>Ze<07>fd<05><08><00>Zej d<06><00><00>Z<08>xZ
S)<07>CompositeOutputDeviceaH
Extends :class:`CompositeDevice` with :meth:`on`, :meth:`off`, and
:meth:`toggle` methods for controlling subordinate output devices. Also
extends :attr:`value` to be writeable.
:param Device \*args:
The un-named devices that belong to the composite device. The
:attr:`~Device.value` attributes of these devices will be represented
within the composite device's tuple :attr:`value` in the order
specified here.
:type _order: list or None
:param _order:
If specified, this is the order of named items specified by keyword
arguments (to ensure that the :attr:`value` tuple is constructed with a
specific order). All keyword arguments *must* be included in the
collection. If omitted, an alphabetically sorted order will be selected
for keyword arguments.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
:param Device \*\*kwargs:
The named devices that belong to the composite device. These devices
will be accessible as named attributes on the resulting device, and
their :attr:`value` attributes will be accessible as named elements of
the composite device's tuple :attr:`value`.
c<00>p<00>|D]2}t|ttf<02><00>r|<01><00><00><00>3dS)z1
Turn all the output devices on.
N)<04>
isinstancerr6<00>on<6F><02>self<6C>devices r2r9zCompositeOutputDevice.oncsC<00><00><1B> <1C> <1C>F<EFBFBD><19>&<26><<3C>1F<31>"G<>H<>H<> <1C><16> <09> <09> <0B> <0B> <0B><> <1C> r4c<00>p<00>|D]2}t|ttf<02><00>r|<01><00><00><00>3dS)z2
Turn all the output devices off.
N)r8rr6<00>offr:s r2r>zCompositeOutputDevice.offksC<00><00><1B> <1D> <1D>F<EFBFBD><19>&<26><<3C>1F<31>"G<>H<>H<> <1D><16>
<EFBFBD>
<EFBFBD> <0C> <0C> <0C><> <1D> r4c<00>p<00>|D]2}t|ttf<02><00>r|<01><00><00><00>3dS)z{
Toggle all the output devices. For each device, if it's on, turn it
off; if it's off, turn it on.
N)r8rr6<00>toggler:s r2r@zCompositeOutputDevice.togglessC<00><00>
<1B> <20> <20>F<EFBFBD><19>&<26><<3C>1F<31>"G<>H<>H<> <20><16> <0A> <0A><0F><0F><0F><> <20> r4c<00>*<00><01>t<00><00>jS)z<>
A tuple containing a value for each subordinate device. This property
can also be set to update the state of all subordinate output devices.
<20><02>super<65>value<75>r;<00> __class__s <20>r2rDzCompositeOutputDevice.value|s<00><><00> <15>w<EFBFBD>w<EFBFBD>}<7D>r4c<00>x<00>t||<01><00>D](\}}t|ttf<02><00>r||_<00>)dSr,)r.r8rr6rD)r;rDr<<00>vs r2rDzCompositeOutputDevice.value<75>sI<00><00><1C>T<EFBFBD>5<EFBFBD>)<29>)<29> !<21> !<21>I<EFBFBD>F<EFBFBD>A<EFBFBD><19>&<26><<3C>1F<31>"G<>H<>H<> !<21> <20><06> <0C><> !<21> !r4) <0B>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__r9r>r@<00>propertyrD<00>setter<65> __classcell__<5F>rFs@r2r6r6Cs<><00><><00><00><00><00><00><08><08>><1C><1C><1C><1D><1D><1D> <20> <20> <20><0E><1D><1D><1D><1D><0E>X<EFBFBD><1D> <0B>\<5C>!<21>!<21><12>\<5C>!<21>!<21>!<21>!<21>!r4r6c<00>n<00><00>eZdZdZdddddddd<06><07>fd<07>
Zed<08><00><00>Ze<07><00>Zd <09>Z <09>fd
<EFBFBD>Z
<EFBFBD>xZ S) <0B> ButtonBoarda<64>
Extends :class:`CompositeDevice` and represents a generic button board or
collection of buttons. The :attr:`value` of the button board is a tuple
of all the buttons states. This can be used to control all the LEDs in a
:class:`LEDBoard` with a :class:`ButtonBoard`::
from gpiozero import LEDBoard, ButtonBoard
from signal import pause
leds = LEDBoard(2, 3, 4, 5)
btns = ButtonBoard(6, 7, 8, 9)
leds.source = btns
pause()
Alternatively you could represent the number of pressed buttons with an
:class:`LEDBarGraph`::
from gpiozero import LEDBarGraph, ButtonBoard
from statistics import mean
from signal import pause
graph = LEDBarGraph(2, 3, 4, 5)
bb = ButtonBoard(6, 7, 8, 9)
graph.source = (mean(values) for values in bb.values)
pause()
:type pins: int or str
:param \*pins:
Specify the GPIO pins that the buttons of the board are attached to.
See :ref:`pin-numbering` for valid pin numbers. You can designate as
many pins as necessary.
:type pull_up: bool or None
:param pull_up:
If :data:`True` (the default), the GPIO pins will be pulled high by
default. In this case, connect the other side of the buttons to
ground. If :data:`False`, the GPIO pins will be pulled low by default.
In this case, connect the other side of the buttons to 3V3. If
:data:`None`, the pin will be floating, so it must be externally pulled
up or down and the ``active_state`` parameter must be set accordingly.
:type active_state: bool or None
:param active_state:
See description under :class:`InputDevice` for more information.
:param float bounce_time:
If :data:`None` (the default), no software bounce compensation will be
performed. Otherwise, this is the length of time (in seconds) that the
buttons will ignore changes in state after an initial change.
:param float hold_time:
The length of time (in seconds) to wait after any button is pushed,
until executing the :attr:`when_held` handler. Defaults to ``1``.
:param bool hold_repeat:
If :data:`True`, the :attr:`when_held` handler will be repeatedly
executed as long as any buttons remain held, every *hold_time* seconds.
If :data:`False` (the default) the :attr:`when_held` handler will be
only be executed once per hold.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
:type named_pins: int or str
:param \*\*named_pins:
Specify GPIO pins that buttons of the board are attached to,
associating each button with a property name. You can designate as
many pins as necessary and use any names, provided they're not already
in use by something else.
TNrF)<07>pull_up<75> active_state<74> bounce_time<6D> hold_time<6D> hold_repeat<61>_order<65> pin_factoryc
<00>0<00><01><00><01><02><03><04><05><07> <0C>t<00><00>j<00><02><03><05><04><07>fd<01>|D<00><00>|<06>d<02><02><02><03><05><04><07>fd<03>| <09><00><00>D<00><00><00><01>t<00><00><00>dkrt d<05><00><00><01>fd<06><08> t <00> fd<07><08>D<00><00><00><00><00>_t<00><00>j<00><00>D]\}
} | |
j_ <00>d<00>_
d<00>_ <00><00> <00>j <00><00><00><00>j<00><00><00><04>_<00><05>_dS)Nc
3<00>D<00>K<00>|]}t|<01><07><02><03><05><04><06><00><00>V<00><00>dS)<02>rSrTrUrVrWrYNr)<08>.0<EFBFBD>pinrTrUrWrVrYrSs <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>r2<00> <genexpr>z'ButtonBoard.__init__.<locals>.<genexpr><3E>s[<00><><00><00><00><0E><0E><18><17>s<EFBFBD>G<EFBFBD>,<2C>#.<2E>)<29>#.<2E>K<EFBFBD>I<01>I<01>I<01><0E><0E><0E><0E><0E>r4<00>rXrYc <00>D<00><06>i|]\}}|t|<02><08><03><04><06><05><07><00><00><00><02>S)r\r) r]<00>namer^rTrUrWrVrYrSs <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>r2<00>
<dictcomp>z(ButtonBoard.__init__.<locals>.<dictcomp><3E>sS<00><><00><0E><0E><0E><1E>D<EFBFBD>#<23><15>f<EFBFBD>S<EFBFBD>'<27> <0C>)4<> <09>)4<>+<2B>O<01>O<01>O<01><0E><0E>r4r<00> No pins givenc<00><00><01><00><00><00>fd<01>}|S)Nc<00><><00><02><00><02>|<00><02>|<01><00><00><00><00><03>|<00>j<00><00>dSr,)<03> _fire_events<74>_state_to_value<75> is_active)<04>ticks<6B>stater<r;s <20><>r2<00>fire_both_eventszGButtonBoard.__init__.<locals>.get_new_handler.<locals>.fire_both_events<74>sE<00><><00><16>#<23>#<23>E<EFBFBD>6<EFBFBD>+A<>+A<>%<25>+H<>+H<>I<>I<>I<><14>!<21>!<21>%<25><14><1E>8<>8<>8<>8<>8r4<00>)r<rlr;s` <20>r2<00>get_new_handlerz-ButtonBoard.__init__.<locals>.get_new_handler<65>s*<00><><EFBFBD><00> 9<> 9<> 9<> 9<> 9<> 9<>$<24> #r4c3<00>.<00>K<00>|]}<00>|<01><00>V<00><00>dSr,rm)r]r<rns <20>r2r_z'ButtonBoard.__init__.<locals>.<genexpr><3E>s-<00><><00><00><00>J<>J<>6<EFBFBD><EFBFBD><EFBFBD>v<EFBFBD>6<>6<>J<>J<>J<>J<>J<>Jr4)rC<00>__init__<5F>items<6D>lenr<00>tuple<6C> _handlersr.r^<00> when_changed<65> _when_changed<65> _last_valuergrYrjrirVrW)r;rSrTrUrVrWrXrY<00>pins<6E>
named_pins<EFBFBD>button<6F>handlerrnrFs`````` ` @<40>r2rpzButtonBoard.__init__<5F>s<><00><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><00> <19><05><07><07><18><0E><0E><0E><0E><0E><0E><0E><0E><0E> <20> <0E><0E><0E> <1A>#<23>
<EFBFBD>
<EFBFBD><0E><0E><0E><0E><0E><0E><0E><0E><0E>",<2C>!1<>!1<>!3<>!3<> <0E><0E><0E>
<EFBFBD>
<EFBFBD>
<EFBFBD> <0F>t<EFBFBD>9<EFBFBD>9<EFBFBD><01>><3E>><3E> <20><1F>1<>1<> 1<> $<24> $<24> $<24> $<24> $<24><1F>J<>J<>J<>J<>T<EFBFBD>J<>J<>J<>J<>J<><04><0E>"<22>4<EFBFBD><14><1E>8<>8<> .<2E> .<2E>O<EFBFBD>F<EFBFBD>G<EFBFBD>&-<2D>F<EFBFBD>J<EFBFBD> #<23> #<23>!<21><04><1A><1F><04><18> <0C><19><19>$<24>*<2A>0<>0<>2<>2<>D<EFBFBD>N<EFBFBD>C<>C<>C<>"<22><04><0E>&<26><04><18><18>r4c<00><00>|djS)zt
If :data:`True`, the device uses a pull-up resistor to set the GPIO pin
"high" by default.
r)rS<00>r;s r2rSzButtonBoard.pull_up<75>s<00><00> <14>A<EFBFBD>w<EFBFBD><EFBFBD>r4c<00>@<00>|jr|<00><00><00>dSdSr,)rur}s r2<00> _fire_changedzButtonBoard._fire_changeds/<00><00> <0F> <1C> <20> <10> <1D> <1D> <1F> <1F> <1F> <1F> <1F> <20> r4c<00><><00><01>t<00><00><00>||<02><00>|j|c}|_|<03>dS||kr|<00><00><00>dSdSr,)rCrgrwr)r;rj<00> new_value<75> old_valuerFs <20>r2rgzButtonBoard._fire_events se<00><><00> <0A><07><07><1C><1C>U<EFBFBD>I<EFBFBD>.<2E>.<2E>.<2E>&*<2A>&6<> <09>#<23> <09>4<EFBFBD>#<23> <14> <1C> <10>D<EFBFBD> <16>)<29> #<23> #<23> <10> <1E> <1E> <20> <20> <20> <20> <20>$<24> #r4) rIrJrKrLrprMrSr(rurrgrOrPs@r2rRrR<00>s<><00><><00><00><00><00><00>I<08>I<08>T'+<2B><14>!<21>Q<EFBFBD>E<EFBFBD><1C>$<24>%'<27>%'<27>%'<27>%'<27>%'<27>%'<27>%'<27>N<0E><1F><1F><0E>X<EFBFBD><1F><19>5<EFBFBD>7<EFBFBD>7<EFBFBD>L<EFBFBD> <20> <20> <20>!<21>!<21>!<21>!<21>!<21>!<21>!<21>!<21>!r4rRc<00>\<00><00>eZdZdZdddddd<05><05>fd<06>
Zed<07><00><00>Zed<08><00><00>Z<07>xZS) <09> LEDCollectionzy
Extends :class:`CompositeOutputDevice`. Abstract base class for
:class:`LEDBoard` and :class:`LEDBarGraph`.
FTN<54><05>pwm<77> active_high<67> initial_valuerXrYc<00><><00><01><02><03><05> <0B>|rtnt<00> t<00><00>j<00> <0B><02><03>fd<01>|D<00><00>|<04>d<02><02> <0B><02><03>fd<03>|<07><00><00>D<00><00><00><01>t |<00><00>dkrt d<05><00><00>g}|D]L} t| t<00><00>r | j D]}
|<08>
|
<EFBFBD><00><00><18>7|<08>
| <09><00><00>Mt|<08><00>|_ dS)Nc3<00>d<00>K<00>|]*}t|t<00><00>r|n<00>|<01><03><04><05><00><00>V<00><00>+dS)<02>r<>r<>rYN<>r8r<>)r]<00>pin_or_collection<6F>LEDClassr<73>r<>rYs <20><><EFBFBD><EFBFBD>r2r_z)LEDCollection.__init__.<locals>.<genexpr>&sm<00><><00><00><00><0E><0E>&<26> <1E>/<2F><1D>?<3F>?<3F><12>!<21>!<21><18><08>%<25>;<3B>"/<2F>[<5B><12><12><12><0E><0E><0E><0E><0E>r4r`c <00>d<00><04>i|],\}}|t|t<00><00>r|n<00>|<02><04><05><06><00><00><00><02>-S)r<>r<>)r]rbr<>r<>r<>r<>rYs <20><><EFBFBD><EFBFBD>r2rcz*LEDCollection.__init__.<locals>.<dictcomp>1sg<00><><00><0E><0E><0E>,<2C>D<EFBFBD>+<2B> <15><1D>/<2F><1D>?<3F>?<3F><12>'<27>'<27><18><08>%<25>;<3B>"/<2F>[<5B><12><12><12><0E><0E>r4rrd) rrrCrprqrrrr8r<><00>leds<64>appendrs<00>_leds) r;r<>r<>r<>rXrYrxryr<><00>item<65>subitemr<6D>rFs `` ` @<40>r2rpzLEDCollection.__init__"sT<00><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><00> <20>)<29>6<EFBFBD>6<EFBFBD>c<EFBFBD><08><18><05><07><07><18><0E><0E><0E><0E><0E><0E><0E>*.<2E><0E><0E><0E><1A>#<23>
<EFBFBD>
<EFBFBD><0E><0E><0E><0E><0E><0E><0E>0:<3A>/?<3F>/?<3F>/A<>/A<><0E><0E><0E>
<EFBFBD>
<EFBFBD>
<EFBFBD>, <0F>t<EFBFBD>9<EFBFBD>9<EFBFBD><01>><3E>><3E> <20><1F>1<>1<> 1<><11><04><18> "<22> "<22>D<EFBFBD><19>$<24> <0A>.<2E>.<2E> "<22>#<23>y<EFBFBD>)<29>)<29>G<EFBFBD><18>K<EFBFBD>K<EFBFBD><07>(<28>(<28>(<28>(<28>)<29><15> <0B> <0B>D<EFBFBD>!<21>!<21>!<21>!<21><1A>4<EFBFBD>[<5B>[<5B><04>
<EFBFBD>
<EFBFBD>
r4c<00><00>|jS)zj
A flat tuple of all LEDs contained in this collection (and all
sub-collections).
)r<>r}s r2r<>zLEDCollection.ledsFs <00><00> <14>z<EFBFBD>r4c<00><00>|djS)Nr)r<>r}s r2r<>zLEDCollection.active_highNs<00><00><13>A<EFBFBD>w<EFBFBD>"<22>"r4) rIrJrKrLrprMr<>r<>rOrPs@r2r<>r<>s<><00><><00><00><00><00><00><08><08>#(<28>T<EFBFBD><15><1C>$<24>"!<21>"!<21>"!<21>"!<21>"!<21>"!<21>"!<21>H<0E><1A><1A><0E>X<EFBFBD><1A><0E>#<23>#<23><0E>X<EFBFBD>#<23>#<23>#<23>#<23>#r4r<>c<00>~<00><00>eZdZdZdddddd<05><05>fd<06>
Z<04>fd<07>Z<05>fd<08>Z<06>fd <09>Z<07>fd
<EFBFBD>Z dd <0A>Z dd<0E>Z
dd<0F>Z dd<11>Z <0C>xZ S)<16>LEDBoardai
Extends :class:`LEDCollection` and represents a generic LED board or
collection of LEDs.
The following example turns on all the LEDs on a board containing 5 LEDs
attached to GPIO pins 2 through 6::
from gpiozero import LEDBoard
leds = LEDBoard(2, 3, 4, 5, 6)
leds.on()
:type pins: int or str or LEDCollection
:param \*pins:
Specify the GPIO pins that the LEDs of the board are attached to. See
:ref:`pin-numbering` for valid pin numbers. You can designate as many
pins as necessary. You can also specify :class:`LEDBoard` instances to
create trees of LEDs.
:param bool pwm:
If :data:`True`, construct :class:`PWMLED` instances for each pin. If
:data:`False` (the default), construct regular :class:`LED` instances.
:param bool active_high:
If :data:`True` (the default), the :meth:`on` method will set all the
associated pins to HIGH. If :data:`False`, the :meth:`on` method will
set all pins to LOW (the :meth:`off` method always does the opposite).
:type initial_value: bool or None
:param initial_value:
If :data:`False` (the default), all LEDs will be off initially. If
:data:`None`, each device will be left in whatever state the pin is
found in when configured for output (warning: this can be on). If
:data:`True`, the device will be switched on initially.
:type _order: list or None
:param _order:
If specified, this is the order of named items specified by keyword
arguments (to ensure that the :attr:`value` tuple is constructed with a
specific order). All keyword arguments *must* be included in the
collection. If omitted, an alphabetically sorted order will be selected
for keyword arguments.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
:type named_pins: int or str
:param \*\*named_pins:
Specify GPIO pins that LEDs of the board are attached to, associating
each LED with a property name. You can designate as many pins as
necessary and use any names, provided they're not already in use by
something else. You can also specify :class:`LEDBoard` instances to
create trees of LEDs.
FTNr<4E>c <00><><00><01>d|_g|_t<00><00>|_t <00><00>j||||||d<01>|<07><01>dS)Nr<4E>)<06> _blink_thread<61> _blink_ledsr<00> _blink_lockrCrp) r;r<>r<>r<>rXrYrxryrFs <20>r2rpzLEDBoard.__init__<5F>sf<00><><00>!<21><04><1A><1D><04><18><1F>6<EFBFBD>6<EFBFBD><04><18><18><05><07><07><18>$<24>C<EFBFBD>[<5B>'4<>V<EFBFBD>%0<> @<01> @<01>4><3E> @<01> @<01> @<01> @<01> @r4c<00><><00><01> |<00><00><00>n#t$rYnwxYwt<00><00><00><00><00>dSr,)<04> _stop_blink<6E>AttributeErrorrC<00>closerEs <20>r2r<>zLEDBoard.close<73>sR<00><><00> <11> <10> <1C> <1C> <1E> <1E> <1E> <1E><><1D> <11> <11> <11> <10>D<EFBFBD> <11><><EFBFBD><EFBFBD> <0A><07><07> <0A> <0A><0F><0F><0F><0F><0F> <00><00>
%<03>%c<00><><00><01>|<00><00><00>|r!|D]}||<00><00><00><00>dSt<00><00><00><00><00>dS)a<>
If no arguments are specified, turn all the LEDs on. If arguments are
specified, they must be the indexes of the LEDs you wish to turn on.
For example::
from gpiozero import LEDBoard
leds = LEDBoard(2, 3, 4, 5)
leds.on(0) # turn on the first LED (pin 2)
leds.on(-1) # turn on the last LED (pin 5)
leds.on(1, 2) # turn on the middle LEDs (pins 3 and 4)
leds.off() # turn off all LEDs
leds.on() # turn on all LEDs
If :meth:`blink` is currently active, it will be stopped first.
:param int args:
The index(es) of the LED(s) to turn on. If no indexes are specified
turn on all LEDs.
N)r<>r9rC<00>r;<00>args<67>indexrFs <20>r2r9z LEDBoard.on<6F>sf<00><><00>* <0A><18><18><1A><1A><1A> <0F> <19><1D> !<21> !<21><05><14>U<EFBFBD> <0B><0E><0E> <20> <20> <20> <20> !<21> !<21> <12>G<EFBFBD>G<EFBFBD>J<EFBFBD>J<EFBFBD>L<EFBFBD>L<EFBFBD>L<EFBFBD>L<EFBFBD>Lr4c<00><><00><01>|<00><00><00>|r!|D]}||<00><00><00><00>dSt<00><00><00><00><00>dS)a<>
If no arguments are specified, turn all the LEDs off. If arguments are
specified, they must be the indexes of the LEDs you wish to turn off.
For example::
from gpiozero import LEDBoard
leds = LEDBoard(2, 3, 4, 5)
leds.on() # turn on all LEDs
leds.off(0) # turn off the first LED (pin 2)
leds.off(-1) # turn off the last LED (pin 5)
leds.off(1, 2) # turn off the middle LEDs (pins 3 and 4)
leds.on() # turn on all LEDs
If :meth:`blink` is currently active, it will be stopped first.
:param int args:
The index(es) of the LED(s) to turn off. If no indexes are
specified turn off all LEDs.
N)r<>r>rCr<>s <20>r2r>z LEDBoard.off<66>sf<00><><00>* <0A><18><18><1A><1A><1A> <0F> <1A><1D> "<22> "<22><05><14>U<EFBFBD> <0B><0F><0F>!<21>!<21>!<21>!<21> "<22> "<22> <12>G<EFBFBD>G<EFBFBD>K<EFBFBD>K<EFBFBD>M<EFBFBD>M<EFBFBD>M<EFBFBD>M<EFBFBD>Mr4c<00><><00><01>|<00><00><00>|r!|D]}||<00><00><00><00>dSt<00><00><00><00><00>dS)a<>
If no arguments are specified, toggle the state of all LEDs. If
arguments are specified, they must be the indexes of the LEDs you wish
to toggle. For example::
from gpiozero import LEDBoard
leds = LEDBoard(2, 3, 4, 5)
leds.toggle(0) # turn on the first LED (pin 2)
leds.toggle(-1) # turn on the last LED (pin 5)
leds.toggle() # turn the first and last LED off, and the
# middle pair on
If :meth:`blink` is currently active, it will be stopped first.
:param int args:
The index(es) of the LED(s) to toggle. If no indexes are specified
toggle the state of all LEDs.
N)r<>r@rCr<>s <20>r2r@zLEDBoard.toggle<6C>sm<00><><00>( <0A><18><18><1A><1A><1A> <0F> <1D><1D> %<25> %<25><05><14>U<EFBFBD> <0B>"<22>"<22>$<24>$<24>$<24>$<24> %<25> %<25> <12>G<EFBFBD>G<EFBFBD>N<EFBFBD>N<EFBFBD> <1C> <1C> <1C> <1C> r4rrc<00>h<00>|jD]9}t|t<00><00>r"|rtd<01><00><00>|rtd<02><00><00><01>:|<00><00><00>t |j|||||f<05><00>|_|j<00><00><00>|s"|j<00> <00><00>d|_dSdS)a
Make all the LEDs turn on and off repeatedly.
:param float on_time:
Number of seconds on. Defaults to 1 second.
:param float off_time:
Number of seconds off. Defaults to 1 second.
:param float fade_in_time:
Number of seconds to spend fading in. Defaults to 0. Must be 0 if
``pwm`` was :data:`False` when the class was constructed
(:exc:`ValueError` will be raised if not).
:param float fade_out_time:
Number of seconds to spend fading out. Defaults to 0. Must be 0 if
``pwm`` was :data:`False` when the class was constructed
(:exc:`ValueError` will be raised if not).
:type n: int or None
:param n:
Number of times to blink; :data:`None` (the default) means forever.
:param bool background:
If :data:`True`, start a background thread to continue blinking and
return immediately. If :data:`False`, only return when the blink is
finished (warning: the default value of *n* will result in this
method never returning).
z(fade_in_time must be 0 with non-PWM LEDsz)fade_out_time must be 0 with non-PWM LEDsN)
r<EFBFBD>r8r<00>
ValueErrorr<EFBFBD>r"<00> _blink_devicer<65><00>start<72>join)r;<00>on_time<6D>off_time<6D> fade_in_time<6D> fade_out_time<6D>n<>
background<EFBFBD>leds r2<00>blinkzLEDBoard.blink<6E>s<><00><00>@<18>9<EFBFBD> R<01> R<01>C<EFBFBD><19>#<23>s<EFBFBD>#<23>#<23> R<01><1F>Q<01>$<24>%O<>P<>P<>P<> <20>R<01>$<24>%P<>Q<>Q<>Q<><51> <0C><18><18><1A><1A><1A>'<27> <10> <1E> <14>h<EFBFBD> <0C>m<EFBFBD>Q<EFBFBD> ?<3F>A<01>A<01><04><1A> <0A><1A> <20> <20>"<22>"<22>"<22><19> &<26> <10> <1E> #<23> #<23> %<25> %<25> %<25>!%<25>D<EFBFBD> <1E> <1E> <1E> &<26> &r4c<00><><00>|<01>+|jr"|j<00><00><00>d|_dSdS|j5|j<00>|<01><00>ddd<00><00>dS#1swxYwYdSr,)r<><00>stopr<70>r<><00>remove)r;r<>s r2r<>zLEDBoard._stop_blink!s<><00><00> <0E>;<3B><13>!<21> *<2A><14>"<22>'<27>'<27>)<29>)<29>)<29>%)<29><04>"<22>"<22>"<22> *<2A> *<2A><16>!<21> -<2D> -<2D><14> <20>'<27>'<27><03>,<2C>,<2C>,<2C> -<2D> -<2D> -<2D> -<2D> -<2D> -<2D> -<2D> -<2D> -<2D> -<2D> -<2D> -<2D><><EFBFBD><EFBFBD> -<2D> -<2D> -<2D> -<2D> -<2D> -s<00>A<03>A!<07>$A!c<00>B<00>dx}}|<00>||||||<04><00>dS)a2
Make all LEDs fade in and out repeatedly. Note that this method will
only work if the *pwm* parameter was :data:`True` at construction time.
:param float fade_in_time:
Number of seconds to spend fading in. Defaults to 1.
:param float fade_out_time:
Number of seconds to spend fading out. Defaults to 1.
:type n: int or None
:param n:
Number of times to blink; :data:`None` (the default) means forever.
:param bool background:
If :data:`True` (the default), start a background thread to
continue blinking and return immediately. If :data:`False`, only
return when the blink is finished (warning: the default value of
*n* will result in this method never returning).
rN)r<>)r;r<>r<>r<>r<>r<>r<>s r2<00>pulsezLEDBoard.pulse*s@<00><00>*<1F><1E><07>(<28> <0C>
<EFBFBD>
<EFBFBD> <13>X<EFBFBD>|<7C>]<5D>A<EFBFBD>z<EFBFBD> K<01> K<01> K<01> K<01> Kr4<00>c<00><><00><03><04><06>g}<07>dkr/|<07><03>fd<02>tt<00><06>z<00><00><00><00>D<00><00>z }|<07>d|f<02><00><00>dkr/|<07><04>fd<04>tt<00><06>z<00><00><00><00>D<00><00>z }|<07>d|f<02><00>|<05>t|<07><00>}n"t jt ||<05><00><00><00>}|j5t|j <00><00>|_
|j
D].}|j d|fvr|j <00> |<08><00>||_ <00>/ ddd<00><00>n #1swxYwY|D]|\} }
|j5|j
s ddd<00><00>dS|j
D]}|<08> | <09><00><00> ddd<00><00>n #1swxYwY|jj<00>|
<EFBFBD><00>rdS<00>}dS)Nrc<00>0<00><02>g|]}|d<00>z z<00>z d<00>z f<02><02>S<00>rrm)r]<00>ir<69><00>fpss <20><>r2<00>
<listcomp>z*LEDBoard._blink_device.<locals>.<listcomp>Gs?<00><><00><0E><0E><0E><15><13>a<EFBFBD>#<23>g<EFBFBD><1D><1C>-<2D>q<EFBFBD>3<EFBFBD>w<EFBFBD>7<><0E><0E>r4rc<00>6<00><02>g|]}d|d<00>z z<00>z z
d<00>z f<02><02>Sr<>rm)r]r<>r<>r<>s <20><>r2r<>z*LEDBoard._blink_device.<locals>.<listcomp>MsD<00><><00><0E><0E><0E><15><13>a<EFBFBD>1<EFBFBD>s<EFBFBD>7<EFBFBD>m<EFBFBD>m<EFBFBD>3<>4<>a<EFBFBD>#<23>g<EFBFBD>><3E><0E><0E>r4)<11>range<67>intr<74>rr<00> from_iterablerr<><00>listr<74>r<><00> _controllerr<72><00>_writer<65><00>stopping<6E>wait) r;r<>r<>r<>r<>r<>r<><00>sequencer<65>rD<00>delays `` ` r2r<>zLEDBoard._blink_deviceCs<><00><><EFBFBD><EFBFBD><00><15><08> <17>!<21> <1B> <1B> <14><0E><0E><0E><0E><0E><1E>s<EFBFBD>3<EFBFBD><1C>#5<>6<>6<>7<>7<><0E><0E><0E> <0E>H<EFBFBD> <11><0F><0F><11>G<EFBFBD> <0C>%<25>%<25>%<25> <18>1<EFBFBD> <1C> <1C> <14><0E><0E><0E><0E><0E><1E>s<EFBFBD>3<EFBFBD><1D>#6<>7<>7<>8<>8<><0E><0E><0E> <0E>H<EFBFBD> <11><0F><0F><11>H<EFBFBD> <0A>&<26>&<26>&<26> <0C>9<EFBFBD><1C>X<EFBFBD><EFBFBD><EFBFBD>H<EFBFBD>H<EFBFBD><1C>*<2A>6<EFBFBD>(<28>A<EFBFBD>+><3E>+><3E>?<3F>?<3F>H<EFBFBD> <11> <1D> '<27> '<27>#<23>D<EFBFBD>I<EFBFBD><EFBFBD><EFBFBD>D<EFBFBD> <1C><1B>'<27> '<27> '<27><03><16>?<3F>4<EFBFBD><14>,<2C>6<>6<><17>O<EFBFBD>/<2F>/<2F><03>4<>4<>4<>"&<26><03><0F><0F> '<27> '<27> '<27> '<27> '<27> '<27> '<27> '<27> '<27> '<27> '<27> '<27><><EFBFBD><EFBFBD> '<27> '<27> '<27> '<27> %<25> <16> <16>L<EFBFBD>E<EFBFBD>5<EFBFBD><15>!<21> &<26> &<26><1B>'<27><1A><19> &<26> &<26> &<26> &<26> &<26> &<26> &<26> &<26> &<26> <20>+<2B>&<26>&<26>C<EFBFBD><17>J<EFBFBD>J<EFBFBD>u<EFBFBD>%<25>%<25>%<25>%<25>&<26> &<26> &<26> &<26> &<26> &<26> &<26> &<26> &<26> &<26> &<26> &<26><><EFBFBD><EFBFBD> &<26> &<26> &<26> &<26>
<14>!<21>*<2A>/<2F>/<2F><05>6<>6<> <16><15><05><05> <16>  <16> s+<00>AD6<03>6D:<07>=D:<07> F<05>&F<05>F <09>F )rrrrNTr,)rrNT)r<>)rIrJrKrLrpr<>r9r>r@r<>r<>r<>r<>rOrPs@r2r<>r<>Vs,<00><><00><00><00><00><00>7<08>7<08>p#(<28>T<EFBFBD><15><1C>$<24>@<01>@<01>@<01>@<01>@<01>@<01>@<01><18><18><18><18><18><19><19><19><19><19>8<1A><1A><1A><1A><1A>8<1D><1D><1D><1D><1D>8HI<01>#<23>-&<26>-&<26>-&<26>-&<26>^-<2D>-<2D>-<2D>-<2D>K<01>K<01>K<01>K<01>4JL<01> <16> <16> <16> <16> <16> <16> <16> r4r<>c<00><><00><00>eZdZdZddddd<06><04>fd<07>
Zed<08><00><00>Zejd <09><00><00>Zed
<EFBFBD><00><00>Zejd <0B><00><00>Z<08>xZ S) <0C> LEDBarGrapha
Extends :class:`LEDCollection` to control a line of LEDs representing a
bar graph. Positive values (0 to 1) light the LEDs from first to last.
Negative values (-1 to 0) light the LEDs from last to first.
The following example demonstrates turning on the first two and last two
LEDs in a board containing five LEDs attached to GPIOs 2 through 6::
from gpiozero import LEDBarGraph
from time import sleep
graph = LEDBarGraph(2, 3, 4, 5, 6)
graph.value = 2/5 # Light the first two LEDs only
sleep(1)
graph.value = -2/5 # Light the last two LEDs only
sleep(1)
graph.off()
As with all other output devices, :attr:`source` and :attr:`values` are
supported::
from gpiozero import LEDBarGraph, MCP3008
from signal import pause
graph = LEDBarGraph(2, 3, 4, 5, 6, pwm=True)
pot = MCP3008(channel=0)
graph.source = pot
pause()
:type pins: int or str
:param \*pins:
Specify the GPIO pins that the LEDs of the bar graph are attached to.
See :ref:`pin-numbering` for valid pin numbers. You can designate as
many pins as necessary.
:param bool pwm:
If :data:`True`, construct :class:`PWMLED` instances for each pin. If
:data:`False` (the default), construct regular :class:`LED` instances.
This parameter can only be specified as a keyword parameter.
:param bool active_high:
If :data:`True` (the default), the :meth:`on` method will set all the
associated pins to HIGH. If :data:`False`, the :meth:`on` method will
set all pins to LOW (the :meth:`off` method always does the opposite).
This parameter can only be specified as a keyword parameter.
:param float initial_value:
The initial :attr:`value` of the graph given as a float between -1 and
+1. Defaults to 0.0. This parameter can only be specified as a
keyword parameter.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
FT<46>N)r<>r<>r<>rYc<00><><00><01>|D]&}t|t<00><00>rtd<01><00><00><01>'t<00><00>j||||d<02><03> ||_dS#|<00><00><00><00>xYw)Nz*Only pins may be specified for LEDBarGraph)r<>r<>rY)r8r#rrCrprDr<>)r;r<>r<>r<>rYrxr^rFs <20>r2rpzLEDBarGraph.__init__<5F>s<><00><><00><18> B<01> B<01>C<EFBFBD><19>#<23>v<EFBFBD>&<26>&<26> B<01>.<2E>@<40>B<01>B<01>B<01> B<01> <19><05><07><07><18> <11>s<EFBFBD> <0B><1B> N<01> N<01> N<01> N<01> <12>&<26>D<EFBFBD>J<EFBFBD>J<EFBFBD>J<EFBFBD><4A> <12> <10>J<EFBFBD>J<EFBFBD>L<EFBFBD>L<EFBFBD>L<EFBFBD> <11><><EFBFBD>s <00>A<00>A'c<00><><00>td<01>|D<00><00><00><00>}|dj|djkr| }|t|<00><00>z S)ab
The value of the LED bar graph. When no LEDs are lit, the value is 0.
When all LEDs are lit, the value is 1. Values between 0 and 1
light LEDs linearly from first to last. Values between 0 and -1
light LEDs linearly from last to first.
To light a particular number of LEDs, simply divide that number by
the number of LEDs. For example, if your graph contains 3 LEDs, the
following will light the first::
from gpiozero import LEDBarGraph
graph = LEDBarGraph(12, 16, 19)
graph.value = 1/3
.. note::
Setting value to -1 will light all LEDs. However, querying it
subsequently will return 1 as both representations are the same in
hardware. The readable range of :attr:`value` is effectively
-1 < value <= 1.
c3<00>$K<00>|] }|jV<00><00> dSr,<00>rD)r]r<>s r2r_z$LEDBarGraph.value.<locals>.<genexpr><3E>s$<00><00><00><00>/<2F>/<2F>3<EFBFBD>S<EFBFBD>Y<EFBFBD>/<2F>/<2F>/<2F>/<2F>/<2F>/r4r<00><><EFBFBD><EFBFBD><EFBFBD>)<03>sumrDrr)r;<00>results r2rDzLEDBarGraph.value<75>sO<00><00>0<15>/<2F>/<2F>$<24>/<2F>/<2F>/<2F>/<2F>/<2F><06> <0F><01>7<EFBFBD>=<3D>4<EFBFBD><02>8<EFBFBD>><3E> )<29> )<29><1C>W<EFBFBD>F<EFBFBD><15><03>D<EFBFBD> <09> <09>!<21>!r4c<00>2<00><01><06>d<01>cxkrdksntd<03><00><00>t|<00><00><00>|}<02>dkrt|<02><00>}<02> <00>t|dt<00><00>r<07><06>fd<05>}n<06><06>fd<06>}t |<02><00>D]\}}||<04><00>|_<00>dS)Nr<4E>rz*LEDBarGraph value must be between -1 and 1rc<00>L<00><02>tdtd<02><01>z|z
<00><00><00><00>S)Nrr)<02>min<69>max<61>r<><00>countrDs <20><>r2<00><lambda>z#LEDBarGraph.value.<locals>.<lambda><3E>s$<00><><00>s<EFBFBD>1<EFBFBD>c<EFBFBD>!<21>U<EFBFBD>U<EFBFBD>]<5D>U<EFBFBD>5J<35>.K<>.K<>'L<>'L<>r4c<00><00><02><00>|dz<00>z kS)Nrrmr<>s <20><>r2r<>z#LEDBarGraph.value.<locals>.<lambda><3E>s<00><><00>u<EFBFBD>%<25>!<21>)<29>u<EFBFBD>1D<31>'E<>r4)rrr<00>reversedr8r<00> enumeraterD)r;rDr<><00>
calc_valuer<EFBFBD>r<>r<>s ` @r2rDzLEDBarGraph.value<75>s<><00><><EFBFBD><00><11>U<EFBFBD><1F><1F><1F><1F>a<EFBFBD><1F><1F><1F><1F>&<26><<3C>><3E>><3E> ><3E><13>D<EFBFBD> <09> <09><05><13><04> <10>1<EFBFBD>9<EFBFBD>9<EFBFBD><1B>D<EFBFBD>><3E>><3E>D<EFBFBD><1A>F<EFBFBD>E<EFBFBD> <15>d<EFBFBD>1<EFBFBD>g<EFBFBD>v<EFBFBD> &<26> &<26> F<01>L<>L<>L<>L<>L<>J<EFBFBD>J<EFBFBD>E<>E<>E<>E<>E<>J<EFBFBD>#<23>D<EFBFBD>/<2F>/<2F> *<2A> *<2A>J<EFBFBD>E<EFBFBD>3<EFBFBD>"<22>
<EFBFBD>5<EFBFBD>)<29>)<29>C<EFBFBD>I<EFBFBD>I<EFBFBD> *<2A> *r4c<00><><00>|jt|<00><00>z}t|dt<00><00>st |<01><00>}|S)z<>
The number of LEDs on the bar graph actually lit up. Note that just
like :attr:`value`, this can be negative if the LEDs are lit from last
to first.
r)rDrrr8rr<>)r;<00> lit_values r2<00> lit_countzLEDBarGraph.lit_count<6E>s=<00><00><19>J<EFBFBD><13>T<EFBFBD><19><19>*<2A> <09><19>$<24>q<EFBFBD>'<27>6<EFBFBD>*<2A>*<2A> '<27><1B>I<EFBFBD><0E><0E>I<EFBFBD><18>r4c<00>4<00>|t|<00><00>z |_dSr,)rrrD<00>r;rDs r2r<>zLEDBarGraph.lit_count<6E>s<00><00><1A>S<EFBFBD><14>Y<EFBFBD>Y<EFBFBD>&<26><04>
<EFBFBD>
<EFBFBD>
r4)
rIrJrKrLrprMrDrNr<>rOrPs@r2r<>r<>fs<><00><><00><00><00><00><00>9<08>9<08>t#(<28>T<EFBFBD><13>!<21> <12> <12> <12> <12> <12> <12> <12><0E>"<22>"<22><0E>X<EFBFBD>"<22>8 <0B>\<5C>*<2A>*<2A><12>\<5C>*<2A> <0E> <19> <19><0E>X<EFBFBD> <19><0F><15>'<27>'<27><16><15>'<27>'<27>'<27>'<27>'r4r<>c<00>L<00><00>eZdZdZ<03>fd<02>Zd<03>Zd<04>Zd<05>Zd<06>Zd<07>Z d<08>Z
d <09>Z <0B>xZ S)
<EFBFBD> LEDCharFonta
Contains a mapping of values to tuples of LED states.
This effectively acts as a "font" for :class:`LEDCharDisplay`, and two
default fonts (for 7-segment and 14-segment displays) are shipped with GPIO
Zero by default. You can construct your own font instance from a
:class:`dict` which maps values (usually single-character strings) to
a tuple of LED states::
from gpiozero import LEDCharDisplay, LEDCharFont
my_font = LEDCharFont({
' ': (0, 0, 0, 0, 0, 0, 0),
'D': (1, 1, 1, 1, 1, 1, 0),
'A': (1, 1, 1, 0, 1, 1, 1),
'd': (0, 1, 1, 1, 1, 0, 1),
'a': (1, 1, 1, 1, 1, 0, 1),
})
display = LEDCharDisplay(26, 13, 12, 22, 17, 19, 6, dp=5, font=my_font)
display.value = 'D'
Font instances are mutable and can be changed while actively in use by
an instance of :class:`LEDCharDisplay`. However, changing the font will
*not* change the state of the LEDs in the display (though it may change
the :attr:`~LEDCharDisplay.value` of the display when next queried).
.. note::
Your custom mapping should always include a value (typically space)
which represents all the LEDs off. This will usually be the default
value for an instance of :class:`LEDCharDisplay`.
You may also wish to load fonts from a friendly text-based format. A simple
parser for such formats (supporting an arbitrary number of segments) is
provided by :func:`gpiozero.fonts.load_segment_font`.
c<00><><00><01>t<00><00><00><00><00>d<01>|<01><00><00>D<00><00>|_|<00><00><00>dS)Nc<00>H<00>i|]\}}|td<00>|D<00><00><00><00><00><02> S)c3<00>NK<00>|] }tt|<01><00><00><00>V<00><00>!dSr,<00>r<><00>bool<6F>r]r^s r2r_z2LEDCharFont.__init__.<locals>.<dictcomp>.<genexpr>s.<00><00><00><00>7<>7<>3<EFBFBD><03>D<EFBFBD><13>I<EFBFBD>I<EFBFBD><0E><0E>7<>7<>7<>7<>7<>7r4)rs)r]<00>charrxs r2rcz(LEDCharFont.__init__.<locals>.<dictcomp>sE<00><00>
<EFBFBD>
<EFBFBD>
<EFBFBD><1A><04>d<EFBFBD> <11>%<25>7<>7<>$<24>7<>7<>7<>7<>7<>
<EFBFBD>
<EFBFBD>
r4)rCrprq<00>_map<61> _refresh_rmap)r;<00>fontrFs <20>r2rpzLEDCharFont.__init__s[<00><><00> <0A><07><07><18><18><1A><1A><1A>
<EFBFBD>
<EFBFBD>"<22>j<EFBFBD>j<EFBFBD>l<EFBFBD>l<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD><04> <09> <0A><1A><1A><1C><1C><1C><1C>r4c<00>N<00>|jj<00>dt|jd<02><03><00><00>d<04>S)N<>(<28>)<01>indent<6E>))rFrIr r<>r}s r2<00>__repr__zLEDCharFont.__repr__s-<00><00><16>.<2E>)<29>K<>K<>G<EFBFBD>D<EFBFBD>I<EFBFBD>a<EFBFBD>,H<>,H<>,H<>K<>K<>K<>Kr4c<00><><00>i}|j<00><00><00>D]\}}|<01>||<02><00><00>||_dSr,)r<>rq<00>
setdefault<EFBFBD>_rmap)r;<00>rmapr<70>rxs r2r<>zLEDCharFont._refresh_rmapsJ<00><00> <12><04><1E>)<29>/<2F>/<2F>+<2B>+<2B> (<28> (<28>J<EFBFBD>D<EFBFBD>$<24> <10>O<EFBFBD>O<EFBFBD>D<EFBFBD>$<24> '<27> '<27> '<27> '<27><19><04>
<EFBFBD>
<EFBFBD>
r4c<00>*<00>t|j<00><00>Sr,)rrr<>r}s r2<00>__len__zLEDCharFont.__len__*s<00><00><12>4<EFBFBD>9<EFBFBD>~<7E>~<7E>r4c<00>*<00>t|j<00><00>Sr,)<02>iterr<72>r}s r2<00>__iter__zLEDCharFont.__iter__-s<00><00><13>D<EFBFBD>I<EFBFBD><EFBFBD><EFBFBD>r4c<00><00>|j|Sr,)r<>)r;r<>s r2<00> __getitem__zLEDCharFont.__getitem__0s<00><00><13>y<EFBFBD><14><EFBFBD>r4c<00><><00> ||=n#t$rYnwxYwtd<01>|D<00><00><00><00>}||j|<|j<00>||<01><00>dS)Nc3<00>NK<00>|] }tt|<01><00><00><00>V<00><00>!dSr,r<>r<>s r2r_z*LEDCharFont.__setitem__.<locals>.<genexpr>:s.<00><00><00><00>4<>4<><03>S<EFBFBD><14>c<EFBFBD><19><19>^<5E>^<5E>4<>4<>4<>4<>4<>4r4)<05>KeyErrorrsr<>r<>r<>)r;r<>rxs r2<00> __setitem__zLEDCharFont.__setitem__3sw<00><00> <11><15>T<EFBFBD>
<EFBFBD>
<EFBFBD><EFBFBD><17> <11> <11> <11> <10>D<EFBFBD> <11><><EFBFBD><EFBFBD><14>4<>4<>t<EFBFBD>4<>4<>4<>4<>4<><04><1E><04> <09>$<24><0F> <0C>
<EFBFBD><1D><1D>d<EFBFBD>D<EFBFBD>)<29>)<29>)<29>)<29>)s <00><00>
<03>c<00><><00>|j|}|j|=|j||kr:|j|=|j<00><00><00>D]\}}||kr ||j|<dS<00>dSdSr,)r<>r<>rq)r;r<>rx<00> char_pinss r2<00> __delitem__zLEDCharFont.__delitem__>s<><00><00><13>y<EFBFBD><14><EFBFBD><04> <10>I<EFBFBD>d<EFBFBD>O<EFBFBD> <10>:<3A>d<EFBFBD> <1B>t<EFBFBD> #<23> #<23><14>
<EFBFBD>4<EFBFBD> <20>#'<27>9<EFBFBD>?<3F>?<3F>#4<>#4<> <1A> <1A><0F><04>i<EFBFBD><17>9<EFBFBD>$<24>$<24>'+<2B>D<EFBFBD>J<EFBFBD>t<EFBFBD>$<24><19>E<EFBFBD>E<EFBFBD>%<25> $<24> #<23> <1A> r4) rIrJrKrLrpr<>r<>r<>rrrr rOrPs@r2r<>r<><00>s<><00><><00><00><00><00><00>#<08>#<08>H<1D><1D><1D><1D><1D>L<01>L<01>L<01> <1A> <1A> <1A><1E><1E><1E><1F><1F><1F><1F><1F><1F> *<2A> *<2A> *<2A>
<1A>
<1A>
<1A>
<1A>
<1A>
<1A>
r4r<>c<00><><00><00>eZdZdZddddddd<06><06>fd<07>
Zed<08><00><00>Zejd <09><00><00>Ze<05>fd
<EFBFBD><08><00>Zejd <0B><00><00>Zd <0C>Z <09>xZ
S) <0A>LEDCharDisplayu<79>
Extends :class:`LEDCollection` for a multi-segment LED display.
`Multi-segment LED displays`_ typically have 7 pins (labelled "a" through
"g") representing 7 LEDs layed out in a figure-of-8 fashion. Frequently, an
eigth pin labelled "dp" is included for a trailing decimal-point:
.. code-block:: text
a
━━━━━
f ┃ ┃ b
┃ g ┃
━━━━━
e ┃ ┃ c
┃ ┃
━━━━━ • dp
d
Other common layouts are 9, 14, and 16 segment displays which include
additional segments permitting more accurate renditions of alphanumerics.
For example:
.. code-block:: text
a
━━━━━
f ┃╲i┃j┃ b
┃ ╲┃k┃
g━━ ━━h
e ┃ ┃╲n┃ c
l┃m╲┃
━━━━━ • dp
d
Such displays have either a common anode, or common cathode pin. This class
defaults to the latter; when using a common anode display *active_high*
should be set to :data:`False`.
Instances of this class can be used to display characters or control
individual LEDs on the display. For example::
from gpiozero import LEDCharDisplay
char = LEDCharDisplay(4, 5, 6, 7, 8, 9, 10, active_high=False)
char.value = 'C'
If the class is constructed with 7 or 14 segments, a default :attr:`font`
will be loaded, mapping some ASCII characters to typical layouts. In other
cases, the default mapping will simply assign " " (space) to all LEDs off.
You can assign your own mapping at construction time or after
instantiation.
While the example above shows the display with a :class:`str` value,
theoretically the *font* can map any value that can be the key in a
:class:`dict`, so the value of the display can be likewise be any valid
key value (e.g. you could map integer digits to LED patterns). That said,
there is one exception to this: when *dp* is specified to enable the
decimal-point, the :attr:`value` must be a :class:`str` as the presence
or absence of a "." suffix indicates whether the *dp* LED is lit.
:type pins: int or str
:param \*pins:
Specify the GPIO pins that the multi-segment display is attached to.
Pins should be in the LED segment order A, B, C, D, E, F, G, and will
be named automatically by the class. If a decimal-point pin is
present, specify it separately as the *dp* parameter.
:type dp: int or str
:param dp:
If a decimal-point segment is present, specify it as this named
parameter.
:type font: dict or None
:param font:
A mapping of values (typically characters, but may also be numbers) to
tuples of LED states. A default mapping for ASCII characters is
provided for 7 and 14 segment displays.
:param bool pwm:
If :data:`True`, construct :class:`PWMLED` instances for each pin. If
:data:`False` (the default), construct regular :class:`LED` instances.
:param bool active_high:
If :data:`True` (the default), the :meth:`on` method will set all the
associated pins to HIGH. If :data:`False`, the :meth:`on` method will
set all pins to LOW (the :meth:`off` method always does the opposite).
:param initial_value:
The initial value to display. Defaults to space (" ") which typically
maps to all LEDs being inactive. If :data:`None`, each device will be
left in whatever state the pin is found in when configured for output
(warning: this can be on).
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _Multi-segment LED displays: https://en.wikipedia.org/wiki/Seven-segment_display
NFT<46> )<06>dpr<70>r<>r<>r<>rYc <00><><00><01>dt|<07><00>cxkrdksntd<03><00><00>|D]&}t|t<00><00>rtd<04><00><00><01>'|<02><>t|<07><00>dkrat jd<06><00><00>d<07><00><00><00><00>5} t| <09><00>}ddd<00><00>n #1swxYwYn<>t|<07><00>dkrat jd<06><00><00>d <09><00><00><00><00>5} t| <09><00>}ddd<00><00>n #1swxYwYnd
d t|<07><00>zi}t|<02><00>|_ d <0C>t|<07><00>D<00><00>}t|<07><00><00><00><00>}
|<01>||d <|
<EFBFBD>d <0A><00>t!<00><00>jd||d|
|d<0E>|<07><01>|<05> ||_dSdS)Nr<00>z1Must have between 2 and 26 LEDs in LEDCharDisplayz*Cannot use LEDCollection in LEDCharDisplay<61>zgpiozero.fontsz7seg.txt<78>z 14seg.txtr <00>rc<00>T<00>i|]%\}}ttd<00><00>|z<00><00>|<02><02>&S)r0)<02>chr<68>ord)r]r<>r^s r2rcz+LEDCharDisplay.__init__.<locals>.<dictcomp><3E>s0<00><00>E<>E<>E<>6<EFBFBD>1<EFBFBD>c<EFBFBD><03>C<EFBFBD><03>H<EFBFBD>H<EFBFBD>q<EFBFBD>L<EFBFBD>!<21>!<21>3<EFBFBD>E<>E<>Er4r r<>rm)rrrr8r<>r<00>files<65>joinpath<74>openr)r*r<><00>_fontr<74><00>sorted<65>keysr<73>rCrprD) r;r r<>r<>r<>r<>rYrxr^<00>f<>orderrFs <20>r2rpzLEDCharDisplay.__init__<5F>s<><00><><00><10>3<EFBFBD>t<EFBFBD>9<EFBFBD>9<EFBFBD>"<22>"<22>"<22>"<22><02>"<22>"<22>"<22>"<22><1F>C<>E<01>E<01> E<01><17> B<01> B<01>C<EFBFBD><19>#<23>}<7D>-<2D>-<2D> B<01>#<23>@<40>B<01>B<01>B<01> B<01> <10><<3C><12>4<EFBFBD>y<EFBFBD>y<EFBFBD>A<EFBFBD>~<7E>~<7E><1E>_<EFBFBD>%5<>6<>6<>?<3F>?<3F>
<EFBFBD>K<>K<>P<>P<>R<>R<>-<2D>VW<56>)<29>!<21>,<2C>,<2C>D<EFBFBD>-<2D>-<2D>-<2D>-<2D>-<2D>-<2D>-<2D>-<2D>-<2D>-<2D>-<2D><><EFBFBD><EFBFBD>-<2D>-<2D>-<2D>-<2D><><14>T<EFBFBD><19><19>b<EFBFBD><1F><1F><1E>_<EFBFBD>%5<>6<>6<>?<3F>?<3F> <0B>L<>L<>Q<>Q<>S<>S<>.<2E>WX<57>*<2A>1<EFBFBD>-<2D>-<2D>D<EFBFBD>.<2E>.<2E>.<2E>.<2E>.<2E>.<2E>.<2E>.<2E>.<2E>.<2E>.<2E><><EFBFBD><EFBFBD>.<2E>.<2E>.<2E>.<2E><><1C>T<EFBFBD>C<EFBFBD><04>I<EFBFBD>I<EFBFBD>-<2D>.<2E><04> <20><14>&<26>&<26><04>
<EFBFBD>E<>E<>Y<EFBFBD>t<EFBFBD>_<EFBFBD>_<EFBFBD>E<>E<>E<><04><16>t<EFBFBD>y<EFBFBD>y<EFBFBD>{<7B>{<7B>#<23>#<23><05> <0A>><3E><1B>D<EFBFBD><14>J<EFBFBD> <11>L<EFBFBD>L<EFBFBD><14> <1E> <1E> <1E><18><05><07><07><18> ;<3B><13><1B>D<EFBFBD><18>k<EFBFBD> ;<3B> ;<3B>59<35> ;<3B> ;<3B> ;<3B> <19> $<24>&<26>D<EFBFBD>J<EFBFBD>J<EFBFBD>J<EFBFBD> %<25> $s$<00>$C<03>C<07>C<07>D4<03>4D8<07>;D8c<00><00>|jS)a<>
An :class:`LEDCharFont` mapping characters to tuples of LED states.
The font is mutable after construction. You can assign a tuple of LED
states to a character to modify the font, delete an existing character
in the font, or assign a mapping of characters to tuples to replace the
entire font.
Note that modifying the :attr:`font` never alters the underlying LED
states. Only assignment to :attr:`value`, or calling the inherited
:class:`LEDCollection` methods (:meth:`on`, :meth:`off`, etc.) modifies
LED states. However, modifying the font may alter the character
returned by querying :attr:`value`.
)rr}s r2r<>zLEDCharDisplay.font<6E>s <00><00><14>z<EFBFBD>r4c<00>.<00>t|<01><00>|_dSr,)r<>rr<>s r2r<>zLEDCharDisplay.font<6E>s<00><00> <20><15>'<27>'<27><04>
<EFBFBD>
<EFBFBD>
r4c<00><><00><01>t<00><00>j}t|d<01><00>r|dd<03>|d}}nd} |jj|}|r|dzS|S#t
$rYdSwxYw)a*
The character the display should show. This is mapped by the current
:attr:`font` to a tuple of LED states which is applied to the
underlying LED objects when this attribute is set.
When queried, the current LED states are looked up in the font to
determine the character shown. If the current LED states do not
correspond to any character in the :attr:`font`, the value is
:data:`None`.
It is possible for multiple characters in the font to map to the same
LED states (e.g. S and 5). In this case, if the font was constructed
from an ordered mapping (which is the default), then the first matching
mapping will always be returned. This also implies that the value
queried need not match the value set.
r Nr<4E>F<>.)rCrD<00>hasattrrr<>r)r;rkr r<>rFs <20>r2rDzLEDCharDisplay.value<75>s<><00><><00>$<16><07><07> <0A><05> <12>4<EFBFBD><14> <1E> <1E> <17><1D>c<EFBFBD>r<EFBFBD>c<EFBFBD>
<EFBFBD>E<EFBFBD>"<22>I<EFBFBD>2<EFBFBD>E<EFBFBD>E<EFBFBD><16>B<EFBFBD> <1E><19>Z<EFBFBD>%<25>e<EFBFBD>,<2C>F<EFBFBD><12> <1E><1D><03>|<7C>#<23><1D> <0A><><18> <18> <18> <18><18>4<EFBFBD>4<EFBFBD>  <18><><EFBFBD>s<00>A<00>
A$<03>#A$c<00>f<00>t||<00>|<01><00><00><00>D] \}}||_<00> dSr,)r.<00> _parse_staterD)r;rDr<>rHs r2rDzLEDCharDisplay.value s@<00><00><19>$<24><04> 1<> 1<>%<25> 8<> 8<>9<>9<> <1A> <1A>F<EFBFBD>C<EFBFBD><11><19>C<EFBFBD>I<EFBFBD>I<EFBFBD> <1A> r4c<00><><00>t|d<01><00>rHt|<01><00>dkr"|<01>d<03><00>r |dd<04>}d}nd}|j||fzS|j|S)Nr rr!r<>r)r"rr<00>endswithr)r;rDr s r2r$zLEDCharDisplay._parse_statesm<00><00> <12>4<EFBFBD><14> <1E> <1E> %<25><12>5<EFBFBD>z<EFBFBD>z<EFBFBD>A<EFBFBD>~<7E>~<7E>%<25>.<2E>.<2E><13>"5<>"5<>~<7E><1D>c<EFBFBD>r<EFBFBD>c<EFBFBD>
<EFBFBD><05><16><02><02><16><02><17>:<3A>e<EFBFBD>$<24><02>u<EFBFBD>,<2C> ,<2C><17>:<3A>e<EFBFBD>$<24> $r4) rIrJrKrLrprMr<>rNrDr$rOrPs@r2r r Ks<><00><><00><00><00><00><00>d<08>d<08>J"&<26>D<EFBFBD>e<EFBFBD><14>"<22><04>'<27>'<27>'<27>'<27>'<27>'<27>'<27>B<0E><1A><1A><0E>X<EFBFBD><1A> 
<EFBFBD>[<5B>(<28>(<28><11>[<5B>(<28><0E>!<1E>!<1E>!<1E>!<1E><0E>X<EFBFBD>!<1E>F <0B>\<5C><1A><1A><12>\<5C><1A> %<25> %<25> %<25> %<25> %<25> %<25> %r4r c<00><><00><00>eZdZdZdddd<04><03>fd<05>
Z<04>fd<06>Zd<07>Zed<08><00><00>Zej d <09><00><00>Zed
<EFBFBD><00><00>Z
e
j d <0B><00><00>Z
d <0C>Z <0B>xZ S) <0A>LEDMultiCharDisplaya<79>
Wraps :class:`LEDCharDisplay` for multi-character `multiplexed`_ LED
character displays.
The class is constructed with a *char* which is an instance of the
:class:`LEDCharDisplay` class, capable of controlling the LEDs in one
character of the display, and an additional set of *pins* that represent
the common cathode (or anode) of each character.
.. warning::
You should not attempt to connect the common cathode (or anode) off
each character directly to a GPIO. Rather, use a set of transistors (or
some other suitable component capable of handling the current of all
the segment LEDs simultaneously) to connect the common cathode to
ground (or the common anode to the supply) and control those
transistors from the GPIOs specified under *pins*.
The *active_high* parameter defaults to :data:`True`. Note that it only
applies to the specified *pins*, which are assumed to be controlling a set
of transistors (hence the default). The specified *char* will use its own
*active_high* parameter. Finally, *initial_value* defaults to a tuple of
:attr:`~LEDCharDisplay.value` attribute of the specified display multiplied
by the number of *pins* provided.
When the :attr:`value` is set such that one or more characters in the
display differ in value, a background thread is implicitly started to
rotate the active character, relying on `persistence of vision`_ to display
the complete value.
.. _multiplexed: https://en.wikipedia.org/wiki/Multiplexed_display
.. _persistence of vision: https://en.wikipedia.org/wiki/Persistence_of_vision
TNr<4E>c<00>8<00><01><02><04>t|t<00><00>std<01><00><00>|<03>|jft |<05><00>z}<03><04>|j<00>d|_d|_t<00><02>fd<03>|D<00><00><00>}t<00><00><00>
||<01><04><04><00>||_dS)Nzchar must be an LEDCharDisplayg{<14>G<EFBFBD>zt?c3<00>><00>K<00>|]}t|<01>d<00><03><01><00>V<00><00>dS)Nr<4E><00>r)r]r^r<>rYs <20><>r2r_z/LEDMultiCharDisplay.__init__.<locals>.<genexpr>HsR<00><><00><00><00>'
<EFBFBD>'
<EFBFBD><14> <19><13><1B>D<EFBFBD>'<27> )<29> )<29> )<29>'
<EFBFBD>'
<EFBFBD>'
<EFBFBD>'
<EFBFBD>'
<EFBFBD>'
r4)<03>plexr<78>rY) r8r r<>rDrrrY<00> _plex_thread<61> _plex_delayr6rCrp)r;r<>r<>r<>rYrxr,rFs ` ` <20>r2rpzLEDMultiCharDisplay.__init__>s<><00><><EFBFBD><EFBFBD><00><19>$<24><0E>/<2F>/<2F> ?<3F><1C>=<3D>><3E>><3E> ><3E> <18> <20>!<21>Z<EFBFBD>M<EFBFBD>C<EFBFBD><04>I<EFBFBD>I<EFBFBD>5<>M<EFBFBD> <16> <1E><1E>*<2A>K<EFBFBD> <20><04><19> <20><04><18>$<24>'
<EFBFBD>'
<EFBFBD>'
<EFBFBD>'
<EFBFBD>'
<EFBFBD><1C> '
<EFBFBD>'
<EFBFBD>'
<EFBFBD> <0B><04> <0E><07><07><18><18><15>D<EFBFBD>k<EFBFBD> <19> ;<3B> ;<3B> ;<3B>"<22><04>
<EFBFBD>
<EFBFBD>
r4c<00><><00><01> |<00><00><00>n#t$rYnwxYwt<00><00><00><00><00>dSr,)<04>
_stop_plexr<EFBFBD>rCr<>rEs <20>r2r<>zLEDMultiCharDisplay.closeRsP<00><><00> <11> <10>O<EFBFBD>O<EFBFBD> <1D> <1D> <1D> <1D><><1D> <11> <11> <11> <10>D<EFBFBD> <11><><EFBFBD><EFBFBD> <0A><07><07> <0A> <0A><0F><0F><0F><0F>r<>c<00>T<00>|jr|j<00><00><00>d|_dSr,)r-r<>r}s r2r0zLEDMultiCharDisplay._stop_plexYs0<00><00> <0F> <1C> %<25> <10> <1D> "<22> "<22> $<24> $<24> $<24> <20><04><19><19>r4c<00><00>|jS)z<>
The delay (measured in seconds) in the loop used to switch each
character in the multiplexed display on. Defaults to 0.005 seconds
which is generally sufficient to provide a "stable" (non-flickery)
display.
)r.r}s r2<00>
plex_delayzLEDMultiCharDisplay.plex_delay^s <00><00><14><1F>r4c<00>X<00>|dkrtd<02><00><00>t|<01><00>|_dS)Nrzplex_delay must be 0 or greater)r<00>floatr.r<>s r2r3zLEDMultiCharDisplay.plex_delayhs.<00><00> <10>1<EFBFBD>9<EFBFBD>9<EFBFBD><1D>?<3F>@<40>@<40> @<40> <20><15><<3C><<3C><04><18><18>r4c<00><00>|jS)a?
The sequence of values to display.
This can be any sequence containing keys from the
:attr:`~LEDCharDisplay.font` of the associated character display. For
example, if the value consists only of single-character strings, it's
valid to assign a string to this property (as a string is simply a
sequence of individual character keys)::
from gpiozero import LEDCharDisplay, LEDMultiCharDisplay
c = LEDCharDisplay(4, 5, 6, 7, 8, 9, 10)
d = LEDMultiCharDisplay(c, 19, 20, 21, 22)
d.value = 'LEDS'
However, things get more complicated if a decimal point is in use as
then this class needs to know explicitly where to break the value for
use on each character of the display. This can be handled by simply
assigning a sequence of strings thus::
from gpiozero import LEDCharDisplay, LEDMultiCharDisplay
c = LEDCharDisplay(4, 5, 6, 7, 8, 9, 10)
d = LEDMultiCharDisplay(c, 19, 20, 21, 22)
d.value = ('L.', 'E', 'D', 'S')
This is how the value will always be represented when queried (as a
tuple of individual values) as it neatly handles dealing with
heterogeneous types and the aforementioned decimal point issue.
.. note::
The value also controls whether a background thread is in use to
multiplex the display. When all positions in the value are equal
the background thread is disabled and all characters are
simultaneously enabled.
<20><01>_valuer}s r2rDzLEDMultiCharDisplay.valuens <00><00>N<14>{<7B>r4c<00>T<00><00><08>t|<01><00>t<00>j<00><00>krtd<01><00><00>t|<01><00>t<00>j<00><00>kr8dt<00>j<00><00>t|<01><00>z
zt|<01><00>z}nt|<01><00>}i<00>t |<01><00>D]c\}}<03>j<00>|<03><00>}t|<04><00>r5<72><08>|t<00><00><00><00><00>
|<02><00><00>dt<00><08><00>}t|<05><00>dkr'<27><00>fd<04>t||dgz<00><00>D<00><00>}ng}<06><00> <00><00><00>j<00><00><00>|r<>t<00>j|d<00><00>D] \}}||_<00> |r5t#<00>j|f<01><00><00>_<00>j<00><00><00>n0<6E>|dD]!}<02>j|<00><00><00><00>"|<01>_dS)NzGlength of value must not exceed the number of characters in the display)r rc <00><><00><02>g|]O\}}<02>fd<00><08>|D<00><00>d<01>t<00>j||<02><00>D<00><00>z<00>fd<02><08>|D<00><00>z<00><02>PS)c<00>.<00><01>g|]}<01>j|df<02><02>Sr<00>r,<00>r]r<>r;s <20>r2r<>z8LEDMultiCharDisplay.value.<locals>.<listcomp>.<listcomp><3E><00>%<00><><00>@<40>@<40>@<40>5<EFBFBD>$<24>)<29>E<EFBFBD>"<22>A<EFBFBD>&<26>@<40>@<40>@r4c<00>(<00>g|]\}}}||z <00> ||f<02><02>Srmrm)r]r<>r<>r<>s r2r<>z8LEDMultiCharDisplay.value.<locals>.<listcomp>.<listcomp><3E>s><00><00><12><12><12>1<><03>Y<EFBFBD> <09> <20>9<EFBFBD>,<2C><12><18>)<29>$<24><12><12>r4c<00>.<00><01>g|]}<01>j|df<02><02>Sr<>r<r=s <20>r2r<>z8LEDMultiCharDisplay.value.<locals>.<listcomp>.<listcomp><3E>r>r4)r.r<>)r]<00>old<6C>newr;<00>statess <20><>r2r<>z-LEDMultiCharDisplay.value.<locals>.<listcomp><3E>s<><00><><00> <0E> <0E> <0E><1D>C<EFBFBD><13>A<01>@<40>@<40>@<40>F<EFBFBD>3<EFBFBD>K<EFBFBD>@<40>@<40>@<40><12><12>58<35><14><19>C<EFBFBD><13>5M<35>5M<35><12><12><12><12> A<01>@<40>@<40>@<40>F<EFBFBD>3<EFBFBD>K<EFBFBD>@<40>@<40>@<40> A<01> <0E> <0E> r4r)rrr,r<>rsr<>r<>r$<00>anyr<79><00>set<65>addrr3r0r>r.rDr"<00> _show_charsr-r<>r9r8) r;rDr<>r<>rkr<00> transitionsr<73>rCs ` @r2rDzLEDMultiCharDisplay.value<75>s&<00><><EFBFBD><00> <0E>u<EFBFBD>:<3A>:<3A><03>D<EFBFBD>I<EFBFBD><0E><0E> &<26> &<26><1C><1E><1F><1F> <1F><11><15>Z<EFBFBD>Z<EFBFBD>#<23>d<EFBFBD>i<EFBFBD>.<2E>.<2E> (<28> (<28><1A>c<EFBFBD>$<24>)<29>n<EFBFBD>n<EFBFBD>s<EFBFBD>5<EFBFBD>z<EFBFBD>z<EFBFBD>9<>:<3A>U<EFBFBD>5<EFBFBD>\<5C>\<5C>I<>E<EFBFBD>E<EFBFBD><19>%<25>L<EFBFBD>L<EFBFBD>E<EFBFBD> <14><06>$<24>U<EFBFBD>+<2B>+<2B> ;<3B> ;<3B>K<EFBFBD>E<EFBFBD>4<EFBFBD><18>I<EFBFBD>*<2A>*<2A>4<EFBFBD>0<>0<>E<EFBFBD><12>5<EFBFBD>z<EFBFBD>z<EFBFBD> ;<3B><16>!<21>!<21>%<25><13><15><15>/<2F>/<2F>3<>3<>E<EFBFBD>:<3A>:<3A>:<3A><>
<17>v<EFBFBD><0E><0E><05> <0E>u<EFBFBD>:<3A>:<3A><01>><3E>><3E> <0E> <0E> <0E> <0E> <0E>!)<29><15>%<25><01>(<28><1A>);<3B> <<3C> <<3C> <0E> <0E> <0E>K<EFBFBD>K<EFBFBD><1D>K<EFBFBD> <0A><0F><0F><19><19><19> <0C> <09> <0A> <0A><0F><0F><0F> <11> *<2A>!<21>$<24>)<29>U<EFBFBD>1<EFBFBD>X<EFBFBD>6<>6<> "<22> "<22>
<EFBFBD><03>U<EFBFBD>!<21><03> <09> <09><1A> *<2A>$.<2E>t<EFBFBD>/?<3F>+<2B><1E>$P<>$P<><04>!<21><14>!<21>'<27>'<27>)<29>)<29>)<29>)<29>#<23>E<EFBFBD>!<21>H<EFBFBD>-<2D>*<2A>*<2A>E<EFBFBD><18>I<EFBFBD>e<EFBFBD>$<24>'<27>'<27>)<29>)<29>)<29>)<29><1B><04> <0B> <0B> r4c<00><><00>t|<01><00>D]8}|D] \}}||_<00> |jj<00>|j<00><00>rdS<00>9dSr,)rrDr-r<>r<>r.)r;rH<00>
transitionr<rDs r2rGzLEDMultiCharDisplay._show_chars<72>sj<00><00><1F> <0B>,<2C>,<2C> <16> <16>J<EFBFBD>!+<2B> %<25> %<25> <0A><06><05>$<24><06> <0C> <0C><13> <20>)<29>.<2E>.<2E>t<EFBFBD>/?<3F>@<40>@<40> <16><15><05><05> <16> <16> r4) rIrJrKrLrpr<>r0rMr3rNrDrGrOrPs@r2r(r(s<00><><00><00><00><00><00> <08> <08>B15<31>D<EFBFBD>!<21>#<23>#<23>#<23>#<23>#<23>#<23>#<23>(<18><18><18><18><18>!<21>!<21>!<21>
<0E> <20> <20><0E>X<EFBFBD> <20><10><16>(<28>(<28><17><16>(<28>
<0E>&<1B>&<1B><0E>X<EFBFBD>&<1B>P <0B>\<5C>8<1C>8<1C><12>\<5C>8<1C>t<16><16><16><16><16><16>r4r(c<00>,<00><00>eZdZdZdddd<04><03>fd<05>
Z<04>xZS)<06> PiHutXmasTreea<65>
Extends :class:`LEDBoard` for `The Pi Hut's Xmas board`_: a 3D Christmas
tree board with 24 red LEDs and a white LED as a star on top.
The 24 red LEDs can be accessed through the attributes led0, led1, led2,
and so on. The white star LED is accessed through the :attr:`star`
attribute. Alternatively, as with all descendents of :class:`LEDBoard`,
you can treat the instance as a sequence of LEDs (the first element is the
:attr:`star`).
The Xmas Tree board pins are fixed and therefore there's no need to specify
them when constructing this class. The following example turns all the LEDs
on one at a time::
from gpiozero import PiHutXmasTree
from time import sleep
tree = PiHutXmasTree()
for light in tree:
light.on()
sleep(1)
The following example turns the star LED on and sets all the red LEDs to
flicker randomly::
from gpiozero import PiHutXmasTree
from gpiozero.tools import random_values
from signal import pause
tree = PiHutXmasTree(pwm=True)
tree.star.on()
for led in tree[1:]:
led.source_delay = 0.1
led.source = random_values()
pause()
:param bool pwm:
If :data:`True`, construct :class:`PWMLED` instances for each pin. If
:data:`False` (the default), construct regular :class:`LED` instances.
:type initial_value: bool or None
:param initial_value:
If :data:`False` (the default), all LEDs will be off initially. If
:data:`None`, each device will be left in whatever state the pin is
found in when configured for output (warning: this can be on). If
:data:`True`, the device will be switched on initially.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _The Pi Hut's Xmas board: https://thepihut.com/xmas
.. attribute:: star
Returns the :class:`LED` or :class:`PWMLED` representing the white
star on top of the tree.
.. attribute:: led0, led1, led2, ...
Returns the :class:`LED` or :class:`PWMLED` representing one of the red
LEDs. There are actually 24 of these properties named led0, led1, and
so on but for the sake of brevity we represent all 24 under this
section.
FN<46>r<>r<>rYc<00><><00><01>td<01><02><00>}d}t|<05><00>D]\}}||d|dzd<06><04><<00>t<00><00>jd|||<04><00><00>|d<07>|<04><01>dS) N<>)<01>star)r<><00><00> <00>r<><00><00><00>
<00><00><00>r<00><00> <00> <00><00><00>r<00><00> r<00><00>r<>r<00>d<>r<>r<>rXrYrm)r r<>rCrpr) r;r<>r<>rY<00> pins_dictrxr<>r^rFs <20>r2rpzPiHutXmasTree.__init__!s<><00><><00><1F>Q<EFBFBD>'<27>'<27>'<27> <09>=<3D><04><1F><04>o<EFBFBD>o<EFBFBD> -<2D> -<2D>F<EFBFBD>A<EFBFBD>s<EFBFBD>),<2C>I<EFBFBD>o<EFBFBD>A<EFBFBD><01>E<EFBFBD>o<EFBFBD>o<EFBFBD>o<EFBFBD> &<26> &<26><18><05><07><07><18>
<EFBFBD><13>=<3D><1C>><3E>><3E>#<23>#<23>#<23>
<EFBFBD>
<EFBFBD><18> 
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4<00>rIrJrKrLrprOrPs@r2rLrL<00>sX<00><><00><00><00><00><00>E<08>E<08>L$<24>5<EFBFBD>d<EFBFBD> 
<EFBFBD> 
<EFBFBD> 
<EFBFBD> 
<EFBFBD> 
<EFBFBD> 
<EFBFBD> 
<EFBFBD> 
<EFBFBD> 
<EFBFBD> 
<EFBFBD> 
r4rLc<00>,<00><00>eZdZdZdddd<05><03>fd<06>
Z<04>xZS)<07>LedBorga<67>
Extends :class:`RGBLED` for the `PiBorg LedBorg`_: an add-on board
containing a very bright RGB LED.
The LedBorg pins are fixed and therefore there's no need to specify them
when constructing this class. The following example turns the LedBorg
purple::
from gpiozero import LedBorg
led = LedBorg()
led.color = (1, 0, 1)
:type initial_value: ~colorzero.Color or tuple
:param initial_value:
The initial color for the LedBorg. Defaults to black ``(0, 0, 0)``.
:param bool pwm:
If :data:`True` (the default), construct :class:`PWMLED` instances for
each component of the LedBorg. If :data:`False`, construct regular
:class:`LED` instances, which prevents smooth color graduations.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _PiBorg LedBorg: https://www.piborg.org/ledborg
)rrrTN)r<>r<>rYc<00>V<00><01>t<00><00><00>ddd|||<03><04><00>dS)N<>BOARD11<31>BOARD13<31>BOARD15)<06>red<65>green<65>bluer<65>r<>rY<00>rCrp)r;r<>r<>rYrFs <20>r2rpzLedBorg.__init__Ns<<00><><00> <0A><07><07><18><18><19><19><19><13>=<3D>k<EFBFBD> <19>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4rgrPs@r2riri/sU<00><><00><00><00><00><00><08><08><)2<>t<EFBFBD><14>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4ric<00>,<00><00>eZdZdZdddd<04><03>fd<05>
Z<04>xZS)<06>PiLitera<72>
Extends :class:`LEDBoard` for the `Ciseco Pi-LITEr`_: a strip of 8 very
bright LEDs.
The Pi-LITEr pins are fixed and therefore there's no need to specify them
when constructing this class. The following example turns on all the LEDs
of the Pi-LITEr::
from gpiozero import PiLiter
lite = PiLiter()
lite.on()
:param bool pwm:
If :data:`True`, construct :class:`PWMLED` instances for each pin. If
:data:`False` (the default), construct regular :class:`LED` instances.
:type initial_value: bool or None
:param initial_value:
If :data:`False` (the default), all LEDs will be off initially. If
:data:`None`, each LED will be left in whatever state the pin is found
in when configured for output (warning: this can be on). If
:data:`True`, the each LED will be switched on initially.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _Ciseco Pi-LITEr: http://shop.ciseco.co.uk/pi-liter-8-led-strip-for-the-raspberry-pi/
FNrMc<00>B<00><01>d}t<00><00>j||||d<02><03>dS<00>N)<08>BOARD7rkrl<00>BOARD12rm<00>BOARD16<31>BOARD18<31>BOARD22rMrq<00>r;r<>r<>rYrxrFs <20>r2rpzPiLiter.__init__v<00>=<00><><00><<3C><04><18><05><07><07><18> <11>s<EFBFBD>-<2D>[<5B>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4rgrPs@r2rsrsUsV<00><><00><00><00><00><00><08><08>@$<24>5<EFBFBD>d<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4rsc<00>,<00><00>eZdZdZdddd<05><03>fd<06>
Z<04>xZS)<07>PiLiterBarGrapha<68>
Extends :class:`LEDBarGraph` to treat the `Ciseco Pi-LITEr`_ as an
8-segment bar graph.
The Pi-LITEr pins are fixed and therefore there's no need to specify them
when constructing this class. The following example sets the graph value
to 0.5::
from gpiozero import PiLiterBarGraph
graph = PiLiterBarGraph()
graph.value = 0.5
:param bool pwm:
If :data:`True`, construct :class:`PWMLED` instances for each pin. If
:data:`False` (the default), construct regular :class:`LED` instances.
:param float initial_value:
The initial :attr:`value` of the graph given as a float between -1 and
+1. Defaults to ``0.0``.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _Ciseco Pi-LITEr: http://shop.ciseco.co.uk/pi-liter-8-led-strip-for-the-raspberry-pi/
Fr<46>NrMc<00>B<00><01>d}t<00><00>j||||d<02><03>dSrurqr{s <20>r2rpzPiLiterBarGraph.__init__<5F>r|r4rgrPs@r2r~r~~sU<00><><00><00><00><00><00><08><08>:$<24>3<EFBFBD>D<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4r~c<00>:<00><00>eZdZdZdddddd<04><04>fd<05> Z<04>fd<06>Z<05>xZS)<08> TrafficLightsaj
Extends :class:`LEDBoard` for devices containing red, yellow, and green
LEDs.
The following example initializes a device connected to GPIO pins 2, 3,
and 4, then lights the amber (yellow) LED attached to GPIO 3::
from gpiozero import TrafficLights
traffic = TrafficLights(2, 3, 4)
traffic.amber.on()
:type red: int or str
:param red:
The GPIO pin that the red LED is attached to. See :ref:`pin-numbering`
for valid pin numbers.
:type amber: int or str or None
:param amber:
The GPIO pin that the amber LED is attached to. See
:ref:`pin-numbering` for valid pin numbers.
:type yellow: int or str or None
:param yellow:
The GPIO pin that the yellow LED is attached to. This is merely an
alias for the ``amber`` parameter; you can't specify both ``amber`` and
``yellow``. See :ref:`pin-numbering` for valid pin numbers.
:type green: int or str
:param green:
The GPIO pin that the green LED is attached to. See
:ref:`pin-numbering` for valid pin numbers.
:param bool pwm:
If :data:`True`, construct :class:`PWMLED` instances to represent each
LED. If :data:`False` (the default), construct regular :class:`LED`
instances.
:type initial_value: bool or None
:param initial_value:
If :data:`False` (the default), all LEDs will be off initially. If
:data:`None`, each device will be left in whatever state the pin is
found in when configured for output (warning: this can be on). If
:data:`True`, the device will be switched on initially.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. attribute:: red
The red :class:`LED` or :class:`PWMLED`.
.. attribute:: amber
The amber :class:`LED` or :class:`PWMLED`. Note that this attribute
will not be present when the instance is constructed with the
*yellow* keyword parameter.
.. attribute:: yellow
The yellow :class:`LED` or :class:`PWMLED`. Note that this attribute
will only be present when the instance is constructed with the
*yellow* keyword parameter.
.. attribute:: green
The green :class:`LED` or :class:`PWMLED`.
NF)r<>r<><00>yellowrYc<00><><00><01>|<02>|<06>td<01><00><00>td|ff<01><00>}|duo|du|_|jr||d<n||d<||d<td<06>|<08><00><00>D<00><00><00><00>s7t d<07>|<08><00><00><00><00><00>d<08><02><00><00>t<00><00>j d
|||<08><00><00>|d <09>|<08><01>dS) Nz,Only one of amber or yellow can be specifiedrnr<><00>amberroc3<00>K<00>|]}|duV<00><00> dSr,rm)r]<00>ps r2r_z)TrafficLights.__init__.<locals>.<genexpr><3E>s&<00><00><00><00>;<3B>;<3B>Q<EFBFBD>1<EFBFBD>D<EFBFBD>=<3D>;<3B>;<3B>;<3B>;<3B>;<3B>;r4<00>, z pins must be providedrerm)
rr <00>_display_yellow<6F>all<6C>valuesrr<>rrCrp)
r;rnr<>ror<>r<>r<>rY<00>devicesrFs
<20>r2rpzTrafficLights.__init__<5F>s(<00><><00> <11> <1C><16>!3<>&<26>><3E>@<01>@<01> @<01><1D><05>s<EFBFBD>|<7C>.<2E>/<2F>/<2F><07>$<24><04>}<7D>C<><16>t<EFBFBD>1C<31><04><1C> <0F> <1F> %<25> &<26>G<EFBFBD>H<EFBFBD> <1D> <1D>$<24>G<EFBFBD>G<EFBFBD> <1C> <20><07><07><18><12>;<3B>;<3B>'<27>.<2E>.<2E>*:<3A>*:<3A>;<3B>;<3B>;<3B>;<3B>;<3B> F<01> <20><17>9<EFBFBD>9<EFBFBD>W<EFBFBD>\<5C>\<5C>^<5E>^<5E>,<2C>,<2C>D<>D<>D<>F<01>F<01> F<01><18><05><07><07><18> <17><13>=<3D><1A><<3C><<3C>><3E>><3E>{<7B> <17> <17><16> <17> <17> <17> <17> r4c<00><><00><01>|dkr
|jrd}n|dkr |jsd}t<00><00><00>|<01><00>S)Nr<4E>r<>)r<>rC<00> __getattr__)r;rbrFs <20>r2r<>zTrafficLights.__getattr__sJ<00><><00> <0F>7<EFBFBD>?<3F>?<3F>t<EFBFBD>3<>?<3F><1B>D<EFBFBD>D<EFBFBD> <11>X<EFBFBD> <1D> <1D>d<EFBFBD>&:<3A> <1D><1A>D<EFBFBD><14>w<EFBFBD>w<EFBFBD>"<22>"<22>4<EFBFBD>(<28>(<28>(r4)NNN)rIrJrKrLrpr<>rOrPs@r2r<>r<><00>sw<00><><00><00><00><00><00>E<08>E<08>L<17><1A>%<25><04>!<21><17><17><17><17><17><17><17>*)<29>)<29>)<29>)<29>)<29>)<29>)<29>)<29>)r4r<>c<00>,<00><00>eZdZdZdddd<04><03>fd<05>
Z<04>xZS)<06> PiTrafficaj
Extends :class:`TrafficLights` for the `Low Voltage Labs PI-TRAFFIC`_
vertical traffic lights board when attached to GPIO pins 9, 10, and 11.
There's no need to specify the pins if the PI-TRAFFIC is connected to the
default pins (9, 10, 11). The following example turns on the amber LED on
the PI-TRAFFIC::
from gpiozero import PiTraffic
traffic = PiTraffic()
traffic.amber.on()
To use the PI-TRAFFIC board when attached to a non-standard set of pins,
simply use the parent class, :class:`TrafficLights`.
:param bool pwm:
If :data:`True`, construct :class:`PWMLED` instances to represent each
LED. If :data:`False` (the default), construct regular :class:`LED`
instances.
:type initial_value: bool or None
:param bool initial_value:
If :data:`False` (the default), all LEDs will be off initially. If
:data:`None`, each device will be left in whatever state the pin is
found in when configured for output (warning: this can be on). If
:data:`True`, the device will be switched on initially.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _Low Voltage Labs PI-TRAFFIC: http://lowvoltagelabs.com/products/pi-traffic/
FNrMc<00>V<00><01>t<00><00><00>ddd|||<03><04><00>dS)N<>BOARD21<32>BOARD19<31>BOARD23rMrq<00>r;r<>r<>rYrFs <20>r2rpzPiTraffic.__init__,s<<00><><00> <0A><07><07><18><18> <15>y<EFBFBD>)<29><13>=<3D>k<EFBFBD> <19>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4rgrPs@r2r<>r<>sV<00><><00><00><00><00><00>"<08>"<08>F$<24>5<EFBFBD>d<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4r<>c<00>B<00><00>eZdZdZddddddd<08>Z d d
d
d d <0B><03>fd <0C> Z<05>xZS)<0E>PiStopa<70>
Extends :class:`TrafficLights` for the `PiHardware Pi-Stop`_: a vertical
traffic lights board.
The following example turns on the amber LED on a Pi-Stop connected to
location ``A+``::
from gpiozero import PiStop
traffic = PiStop('A+')
traffic.amber.on()
:param str location:
The `location`_ on the GPIO header to which the Pi-Stop is connected.
Must be one of: ``A``, ``A+``, ``B``, ``B+``, ``C``, ``D``.
:param bool pwm:
If :data:`True`, construct :class:`PWMLED` instances to represent each
LED. If :data:`False` (the default), construct regular :class:`LED`
instances.
:type initial_value: bool or None
:param bool initial_value:
If :data:`False` (the default), all LEDs will be off initially. If
:data:`None`, each device will be left in whatever state the pin is
found in when configured for output (warning: this can be on). If
:data:`True`, the device will be switched on initially.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _PiHardware Pi-Stop: https://pihw.wordpress.com/meltwaters-pi-hardware-kits/pi-stop/
.. _location: https://github.com/PiHw/Pi-Stop/blob/master/markdown_source/markdown/Discover-PiStop.md
)<03>BOARD26<32>BOARD24rz)<03>BOARD40<34>BOARD38<33>BOARD36)r<>r<>r<>)<03>BOARD33<33>BOARD35<33>BOARD37)rw<00>BOARD10<31>BOARD8)<03>BOARD3<44>BOARD5rv)<06>AzA+<2B>BzB+<2B>C<>DNFrMc<00><00><01>|j<00>|d<00><00>}|<05>Kd<01>t|j<00><00><00><00><00><00><00>}t d|<06><00><02><00><00>t <00><00>j||||d<03><03>dS)Nr<4E>zlocation must be one of: rM)<08> LOCATIONS<4E>getr<74>rrr<>rCrp)r;<00>locationr<6E>r<>rY<00>gpios<6F> locationsrFs <20>r2rpzPiStop.__init__as<><00><><00><15><0E>"<22>"<22>8<EFBFBD>T<EFBFBD>2<>2<><05> <10>=<3D><1C> <09> <09>&<26><14><1E>)<<3C>)<<3C>)><3E>)><3E>"?<3F>"?<3F>@<40>@<40>I<EFBFBD><1C>D<><19>D<>D<>E<>E<> E<><18><05><07><07><18> <12><03>=<3D>#<23> %<25> %<25> %<25> %<25> %<25> %r4r,)rIrJrKrLr<>rprOrPs@r2r<>r<>3s<00><><00><00><00><00><00>#<08>#<08>J/<2F>/<2F> .<2E>/<2F> -<2D> +<2B> <06><06>I<EFBFBD> <20> %<25>(-<2D>U<EFBFBD><1C> %<25> %<25> %<25> %<25> %<25> %<25> %<25> %<25> %<25> %<25> %r4r<>c<00>0<00><00>eZdZdZdZdddd<05><03>fd<06>
Z<05>xZS)<07>
StatusZeroa<EFBFBD>
Extends :class:`LEDBoard` for The Pi Hut's `STATUS Zero`_: a Pi Zero sized
add-on board with three sets of red/green LEDs to provide a status
indicator.
The following example designates the first strip the label "wifi" and the
second "raining", and turns them green and red respectfully::
from gpiozero import StatusZero
status = StatusZero('wifi', 'raining')
status.wifi.green.on()
status.raining.red.on()
Each designated label will contain two :class:`LED` objects named "red"
and "green".
:param str \*labels:
Specify the names of the labels you wish to designate the strips to.
You can list up to three labels. If no labels are given, three strips
will be initialised with names 'one', 'two', and 'three'. If some, but
not all strips are given labels, any remaining strips will not be
initialised.
:param bool pwm:
If :data:`True`, construct :class:`PWMLED` instances to represent each
LED. If :data:`False` (the default), construct regular :class:`LED`
instances.
:type initial_value: bool or None
:param bool initial_value:
If :data:`False` (the default), all LEDs will be off initially. If
:data:`None`, each device will be left in whatever state the pin is
found in when configured for output (warning: this can be on). If
:data:`True`, the device will be switched on initially.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _STATUS Zero: https://thepihut.com/statuszero
.. attribute:: your-label-here, your-label-here, ...
This entry represents one of the three labelled attributes supported on
the STATUS Zero board. It is an :class:`LEDBoard` which contains:
.. attribute:: red
The :class:`LED` or :class:`PWMLED` representing the red LED
next to the label.
.. attribute:: green
The :class:`LED` or :class:`PWMLED` representing the green LED
next to the label.
)<03>one<6E>two<77>threeFNrMc <00><><00><01><01><02><03>d}t|<04><00>dkr|j}n@t|<04><00>t|<05><00>kr tdt|<05><00><00>d<04><03><00><00>t|<04><00><00>d<05><00>d\}}|dkrtd|<06><00><02><00><00>t <00><00>jd |<04>d<07><02><02><03>fd<08>t||<04><00>D<00><00><00><01>dS)
N))rkrv)rmrl)r<>r<>rz%StatusZero doesn't support more than z labelsr<00>Duplicate label r`c <00>H<00><03>i|]\\}}}|t||d<00><06><04><05><01><00><00><02>S)<02>rnro<00>rnrorXr<>r<>rY)r<>)r]rorn<00>labelr<6C>rYr<>s <20><><EFBFBD>r2rcz'StatusZero.__init__.<locals>.<dictcomp><3E>sT<00><><00>7<0E>7<0E>7<0E>
(<28>L<EFBFBD>U<EFBFBD>C<EFBFBD>%<25> <16>x<EFBFBD><1B>5<EFBFBD>1A<31><1B>=<3D> +<2B>-<2D>-<2D>-<2D>7<0E>7<0E>7r4rm<00>rr<00>default_labelsr<73>r
<00> most_commonrCrpr.<00> r;r<>r<>rY<00>labelsrx<00>dupr<70>rFs ``` <20>r2rpzStatusZero.__init__<5F>s!<00><><EFBFBD><EFBFBD><EFBFBD><00>
<EFBFBD><04>
<0F>v<EFBFBD>;<3B>;<3B>!<21> <1B> <1B><19>(<28>F<EFBFBD>F<EFBFBD> <10><16>[<5B>[<5B>3<EFBFBD>t<EFBFBD>9<EFBFBD>9<EFBFBD> $<24> $<24><1C>J<><03>D<EFBFBD> <09> <09>J<>J<>J<>L<01>L<01> L<01><1C>V<EFBFBD>_<EFBFBD>_<EFBFBD>0<>0<><11>3<>3<>A<EFBFBD>6<>
<EFBFBD><03>U<EFBFBD> <10>1<EFBFBD>9<EFBFBD>9<EFBFBD><1C>5<><03>5<>5<>6<>6<> 6<><18><05><07><07><18>
<EFBFBD><19>{<7B>
<EFBFBD>
<EFBFBD>7<0E>7<0E>7<0E>7<0E>7<0E>7<0E>
,/<2F>t<EFBFBD>V<EFBFBD>+<<3C>+<<3C> 7<0E>7<0E>7<0E>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4<00>rIrJrKrLr<>rprOrPs@r2r<>r<>ms\<00><><00><00><00><00><00>9<08>9<08>t-<2D>N<EFBFBD>$)<29><15>!<21>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4r<>c<00>0<00><00>eZdZdZdZdddd<05><03>fd<06>
Z<05>xZS)<07> StatusBoardac
Extends :class:`CompositeOutputDevice` for The Pi Hut's `STATUS`_ board: a
HAT sized add-on board with five sets of red/green LEDs and buttons to
provide a status indicator with additional input.
The following example designates the first strip the label "wifi" and the
second "raining", turns the wifi green and then activates the button to
toggle its lights when pressed::
from gpiozero import StatusBoard
status = StatusBoard('wifi', 'raining')
status.wifi.lights.green.on()
status.wifi.button.when_pressed = status.wifi.lights.toggle
Each designated label will contain a "lights" :class:`LEDBoard` containing
two :class:`LED` objects named "red" and "green", and a :class:`Button`
object named "button".
:param str \*labels:
Specify the names of the labels you wish to designate the strips to.
You can list up to five labels. If no labels are given, five strips
will be initialised with names 'one' to 'five'. If some, but not all
strips are given labels, any remaining strips will not be initialised.
:param bool pwm:
If :data:`True`, construct :class:`PWMLED` instances to represent each
LED. If :data:`False` (the default), construct regular :class:`LED`
instances.
:type initial_value: bool or None
:param bool initial_value:
If :data:`False` (the default), all LEDs will be off initially. If
:data:`None`, each device will be left in whatever state the pin is
found in when configured for output (warning: this can be on). If
:data:`True`, the device will be switched on initially.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _STATUS: https://thepihut.com/status
.. attribute:: your-label-here, your-label-here, ...
This entry represents one of the five labelled attributes supported on
the STATUS board. It is an :class:`CompositeOutputDevice` which
contains:
.. attribute:: lights
A :class:`LEDBoard` representing the lights next to the label. It
contains:
.. attribute:: red
The :class:`LED` or :class:`PWMLED` representing the red LED
next to the label.
.. attribute:: green
The :class:`LED` or :class:`PWMLED` representing the green LED
next to the label.
.. attribute:: button
A :class:`Button` representing the button next to the label.
)r<>r<>r<><00>four<75>fiveFNrMc <00><><00><01><01><02><03>d}t|<04><00>dkr|j}n/t|<04><00>t|<05><00>krtd<03><00><00>t|<04><00><00>d<04><00>d\}}|dkrtd|<06><00><02><00><00>t <00><00>jd|<04>d<06><02><02><03>fd<07>t||<04><00>D<00><00><00><01>dS) N))rkrvr<>)rmrlr<>)r<>r<>r<>)<03>BOARD29r<39>r<>)r<><00>BOARD31rwrz1StatusBoard doesn't support more than five labelsrr<>r`c<00><><00><03>i|]?\\}}}}|tt|<03><06><00><00>t||d<01><07><05><06><02><00>d<03><06><04><00><00><02>@S)<05>rYr<>r<>)rz<00>lights)rzr<>rXrY)r6rr<>)r]rornrzr<>r<>rYr<>s <20><><EFBFBD>r2rcz(StatusBoard.__init__.<locals>.<dictcomp>s<><00><><00>
7<0E>
7<0E>
7<0E>0<>(<28>U<EFBFBD>C<EFBFBD><16>%<25><16>,<2C>!<21>&<26>k<EFBFBD>B<>B<>B<>#<23><1F>u<EFBFBD>5E<35><1F>}<7D>$/<2F>1<>1<>1<>0<>[<5B> <12><12><12>
7<0E>
7<0E>
7r4rmr<>r<>s ``` <20>r2rpzStatusBoard.__init__ s<00><><EFBFBD><EFBFBD><EFBFBD><00>
<EFBFBD><04> <0F>v<EFBFBD>;<3B>;<3B>!<21> <1B> <1B><19>(<28>F<EFBFBD>F<EFBFBD> <10><16>[<5B>[<5B>3<EFBFBD>t<EFBFBD>9<EFBFBD>9<EFBFBD> $<24> $<24><1C>P<>Q<>Q<> Q<><1C>V<EFBFBD>_<EFBFBD>_<EFBFBD>0<>0<><11>3<>3<>A<EFBFBD>6<>
<EFBFBD><03>U<EFBFBD> <10>1<EFBFBD>9<EFBFBD>9<EFBFBD><1C>5<><03>5<>5<>6<>6<> 6<><18><05><07><07><18>
<EFBFBD><19>{<7B>
<EFBFBD>
<EFBFBD>
7<0E>
7<0E>
7<0E>
7<0E>
7<0E>
7<0E>47<34>t<EFBFBD>V<EFBFBD>3D<33>3D<33>
7<0E>
7<0E>
7<0E>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4r<>rPs@r2r<>r<><00>s^<00><><00><00><00><00><00>D<08>D<08>J=<3D>N<EFBFBD>$)<29><15>!<21>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4r<>c<00>,<00><00>eZdZdZdddd<04><03>fd<05>
Z<04>xZS)<06>SnowPia<69>
Extends :class:`LEDBoard` for the `Ryanteck SnowPi`_ board.
The SnowPi pins are fixed and therefore there's no need to specify them
when constructing this class. The following example turns on the eyes, sets
the nose pulsing, and the arms blinking::
from gpiozero import SnowPi
snowman = SnowPi(pwm=True)
snowman.eyes.on()
snowman.nose.pulse()
snowman.arms.blink()
:param bool pwm:
If :data:`True`, construct :class:`PWMLED` instances to represent each
LED. If :data:`False` (the default), construct regular :class:`LED`
instances.
:type initial_value: bool or None
:param bool initial_value:
If :data:`False` (the default), all LEDs will be off initially. If
:data:`None`, each device will be left in whatever state the pin is
found in when configured for output (warning: this can be on). If
:data:`True`, the device will be switched on initially.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _Ryanteck SnowPi: https://ryanteck.uk/raspberry-pi/114-snowpi-the-gpio-snowman-for-raspberry-pi-0635648608303.html
.. attribute:: arms
A :class:`LEDBoard` representing the arms of the snow man. It contains
the following attributes:
.. attribute:: left, right
Two :class:`LEDBoard` objects representing the left and right arms
of the snow-man. They contain:
.. attribute:: top, middle, bottom
The :class:`LED` or :class:`PWMLED` down the snow-man's arms.
.. attribute:: eyes
A :class:`LEDBoard` representing the eyes of the snow-man. It contains:
.. attribute:: left, right
The :class:`LED` or :class:`PWMLED` for the snow-man's eyes.
.. attribute:: nose
The :class:`LED` or :class:`PWMLED` for the snow-man's nose.
FNrMc<00><><00><01>t<00><00><00>ttddd||d|<03><05><00>tddd||d|<03><05><00>d |<03>
<EFBFBD><00>td d ||d |<03> <0A><00>d||d|<03><10><00>dS)Nrkrwrm)<03>top<6F>middle<6C>bottom)r<>r<>r<>r<>r<>rXrYr<>r<>r<><00><02>left<66>right)r<>r<>rXrYrxry<00>r<>r<>r<>r<>rXrYrz)<03>eyes<65>nose<73>arms)r<>r<>r<>r<>r<>rXrY<00>rCrpr<>r<>s <20>r2rpzSnowPi.__init__gs<><00><><00> <0A><07><07><18><18><19><1D>!<21>)<29>I<EFBFBD><1B>=<3D>6<> +<2B> -<2D>-<2D>-<2D>
<1F>!<21>)<29>I<EFBFBD><1B>=<3D>6<> +<2B> -<2D>-<2D>-<2D>
)<29>'<27> <12> <12> <12><1A><1E>i<EFBFBD><17>}<7D>(<28>'<27> <12><12><12> <1B><13>=<3D>+<2B>#<23>1 <19>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4rgrPs@r2r<>r<>+sV<00><><00><00><00><00><00>:<08>:<08>v$<24>5<EFBFBD>d<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4r<>c<00>(<00><00>eZdZdZdd<03><01>fd<04>
Z<04>xZS)<05>TrafficLightsBuzzera<72>
Extends :class:`CompositeOutputDevice` and is a generic class for HATs with
traffic lights, a button and a buzzer.
:param TrafficLights lights:
An instance of :class:`TrafficLights` representing the traffic lights
of the HAT.
:param Buzzer buzzer:
An instance of :class:`Buzzer` representing the buzzer on the HAT.
:param Button button:
An instance of :class:`Button` representing the button on the HAT.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. attribute:: lights
The :class:`TrafficLights` instance passed as the *lights* parameter.
.. attribute:: buzzer
The :class:`Buzzer` instance passed as the *buzzer* parameter.
.. attribute:: button
The :class:`Button` instance passed as the *button* parameter.
Nr<4E>c<00>T<00><01>t<00><00><00>|||d|<04><02><00>dS)N<>r<><00>buzzerrz<00>r<>r<>rzrXrYrq)r;r<>r<>rzrYrFs <20>r2rpzTrafficLightsBuzzer.__init__<5F>s;<00><><00> <0A><07><07><18><18><19>&<26><16>1<>#<23> <19>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4rgrPs@r2r<>r<><00>sR<00><><00><00><00><00><00><08><08>>?C<01>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4r<>c<00>*<00><00>eZdZdZddd<04><02>fd<05>
Z<04>xZS)<06>FishDisha<68>
Extends :class:`CompositeOutputDevice` for the `Pi Supply FishDish`_: traffic
light LEDs, a button and a buzzer.
The FishDish pins are fixed and therefore there's no need to specify them
when constructing this class. The following example waits for the button
to be pressed on the FishDish, then turns on all the LEDs::
from gpiozero import FishDish
fish = FishDish()
fish.button.wait_for_press()
fish.lights.on()
:param bool pwm:
If :data:`True`, construct :class:`PWMLED` instances to represent each
LED. If :data:`False` (the default), construct regular :class:`LED`
instances.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _Pi Supply FishDish: https://www.pi-supply.com/product/fish-dish-raspberry-pi-led-buzzer-board/
FN<46>r<>rYc <00><><00><01>t<00><00><00>tddd||<02><04><00>td|<02><06><00>t dd|<02> <09><00>d
|<02> <0B><00>dS) Nr<4E>rmrvr<>r<>r<>r<>F<>rSrYr<>r<><00>rCrpr<>rr<00>r;r<>rYrFs <20>r2rpzFishDish.__init__<5F>su<00><><00> <0A><07><07><18><18> <20><19>9<EFBFBD>h<EFBFBD>C<EFBFBD>[<5B><0E><0E><0E><1A>)<29><1B>=<3D>=<3D>=<3D><19>)<29>U<EFBFBD> <0B>L<>L<>L<>1<>#<23> <19>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4rgrPs@r2r<>r<><00>sS<00><><00><00><00><00><00><08><08>4$<24><14> 
<EFBFBD> 
<EFBFBD> 
<EFBFBD> 
<EFBFBD> 
<EFBFBD> 
<EFBFBD> 
<EFBFBD> 
<EFBFBD> 
<EFBFBD> 
<EFBFBD> 
r4r<>c<00>*<00><00>eZdZdZddd<04><02>fd<05>
Z<04>xZS)<06>
TrafficHata<EFBFBD>
Extends :class:`CompositeOutputDevice` for the `Pi Supply Traffic HAT`_: a
board with traffic light LEDs, a button and a buzzer.
The Traffic HAT pins are fixed and therefore there's no need to specify
them when constructing this class. The following example waits for the
button to be pressed on the Traffic HAT, then turns on all the LEDs::
from gpiozero import TrafficHat
hat = TrafficHat()
hat.button.wait_for_press()
hat.lights.on()
:param bool pwm:
If :data:`True`, construct :class:`PWMLED` instances to represent each
LED. If :data:`False` (the default), construct regular :class:`LED`
instances.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _Pi Supply Traffic HAT: https://uk.pi-supply.com/products/traffic-hat-for-raspberry-pi
FNr<4E>c <00><><00><01>t<00><00><00>tddd||<02><04><00>td|<02><06><00>t d|<02><06><00>d|<02> <09><00>dS)
Nryrxrmr<>r<>r<>rzr<>r<>r<>r<>s <20>r2rpzTrafficHat.__init__<5F>st<00><><00> <0A><07><07><18><18> <20><19>9<EFBFBD>i<EFBFBD><17>[<5B><0E><0E><0E><1A>)<29><1B>=<3D>=<3D>=<3D><19>)<29><1B>=<3D>=<3D>=<3D>1<>#<23> <19>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4rgrPs@r2r<>r<><00>sS<00><><00><00><00><00><00><08><08>4$<24><14>

<EFBFBD>

<EFBFBD>

<EFBFBD>

<EFBFBD>

<EFBFBD>

<EFBFBD>

<EFBFBD>

<EFBFBD>

<EFBFBD>

<EFBFBD>

r4r<>c<00>,<00><00>eZdZdZdddd<04><03>fd<05>
Z<04>xZS)<06> TrafficpHata<74>
Extends :class:`TrafficLights` for the `Pi Supply Traffic pHAT`_: a small
board with traffic light LEDs.
The Traffic pHAT pins are fixed and therefore there's no need to specify
them when constructing this class. The following example then turns on all
the LEDs::
from gpiozero import TrafficpHat
phat = TrafficpHat()
phat.red.on()
phat.blink()
:param bool pwm:
If :data:`True`, construct :class:`PWMLED` instances to represent each
LED. If :data:`False` (the default), construct regular :class:`LED`
instances.
:type initial_value: bool or None
:param initial_value:
If :data:`False` (the default), all LEDs will be off initially. If
:data:`None`, each device will be left in whatever state the pin is
found in when configured for output (warning: this can be on). If
:data:`True`, the device will be switched on initially.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _Pi Supply Traffic pHAT: http://pisupp.ly/trafficphat
FNrMc<00>V<00><01>t<00><00><00>ddd|||<03><04><00>dS)Nrzryrx)rnr<>ror<>r<>rYrqr<>s <20>r2rpzTrafficpHat.__init__s<<00><><00> <0A><07><07><18><18><19><19>)<29><13>=<3D>k<EFBFBD> <19>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4rgrPs@r2r<>r<><00>sV<00><><00><00><00><00><00><08><08>@$<24>5<EFBFBD>d<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4r<>Tc<00><><00>tjtd<01><00><00><00>tt |<00>t |<01>g|<04>R||d<02><02>S)z<>
Deprecated alias of :class:`Robot`. The :class:`Robot` class can now be
constructed directly with :class:`Motor` or :class:`PhaseEnableMotor`
classes.
z_PhaseEnableRobot is deprecated; please construct Robot directly with PhaseEnableMotor instancesr<73>)<05>warnings<67>warn<72>DeprecationWarning<6E>Robotr )r<>r<>r<>rYr<>s r2<00>PhaseEnableRobotr<74>#sn<00><00>  <0A>M<EFBFBD><1A> .<2E> /<2F> /<2F>0<>0<>0<> <11><18>$<24><1F><18>%<25> <20> <0F>
<0E>  <0F> <0F> <10>[<5B> <0F> <0F> <0F>r4c<00><><00><00>eZdZdZdd<03><01>fd<04>
Ze<05>fd<05><08><00>Zejd<06><00><00>Zdddd <09>d
<EFBFBD>Zdddd <09>d <0B>Z dd <0C>Z
dd <0A>Z d<0E>Z d<0F>Z <0A>xZS)r<>a<>
Extends :class:`CompositeDevice` to represent a generic dual-motor robot.
This class is constructed with two motor instances representing the left
and right wheels of the robot respectively. For example, if the left
motor's controller is connected to GPIOs 4 and 14, while the right motor's
controller is connected to GPIOs 17 and 18 then the following example will
drive the robot forward::
from gpiozero import Robot
robot = Robot(left=Motor(4, 14), right=Motor(17, 18))
robot.forward()
:type left: Motor or PhaseEnableMotor
:param left:
A :class:`~gpiozero.Motor` or a :class:`~gpiozero.PhaseEnableMotor`
for the left wheel of the robot.
:type right: Motor or PhaseEnableMotor
:param right:
A :class:`~gpiozero.Motor` or a :class:`~gpiozero.PhaseEnableMotor`
for the right wheel of the robot.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. attribute:: left_motor
The :class:`Motor` on the left of the robot.
.. attribute:: right_motor
The :class:`Motor` on the right of the robot.
Nr<4E>c<00>
<00><01>t|ttf<02><00>sRt|t<00><00>r.t jt d<01><00><00><00>t|d|i<01>}ntd<03><00><00>t|ttf<02><00>sRt|t<00><00>r.t jt d<04><00><00><00>t|d|i<01>}ntd<05><00><00>t<00><00><00> ||d|<03><07><00>dS)Nz<4E>Passing a tuple as the left parameter of the Robot constructor is deprecated; please pass a Motor or PhaseEnableMotor instance insteadrYz(left must be a Motor or PhaseEnableMotorz<72>Passing a tuple as the right parameter of the Robot constructor is deprecated; please pass a Motor or PhaseEnableMotor instance insteadz)right must be a Motor or PhaseEnableMotor)<02>
left_motor<EFBFBD> right_motor)r<>r<>rXrY)
r8rr rsr<>r<>r<>rrCrp)r;r<>r<>rYrFs <20>r2rpzRobot.__init__Zs&<00><><00><19>$<24><15>(8<> 9<>:<3A>:<3A> Q<01><19>$<24><05>&<26>&<26> Q<01><18> <0A>&<26><<3C>=<3D>=<3D>><3E>><3E>><3E>
<1D>d<EFBFBD><<3C> <0B><<3C><<3C><04><04>$<24>%O<>P<>P<>P<><19>%<25>%<25>)9<>!:<3A>;<3B>;<3B> R<01><19>%<25><15>'<27>'<27> R<01><18> <0A>&<26><<3C>=<3D>=<3D>><3E>><3E>><3E>
<1E>u<EFBFBD>><3E>+<2B>><3E>><3E><05><05>$<24>%P<>Q<>Q<>Q<> <0A><07><07><18><18>D<EFBFBD>e<EFBFBD> =<3D>%0<> <19> 2<> 2<> 2<> 2<> 2r4c<00>*<00><01>t<00><00>jS)a
Represents the motion of the robot as a tuple of (left_motor_speed,
right_motor_speed) with ``(-1, -1)`` representing full speed backwards,
``(1, 1)`` representing full speed forwards, and ``(0, 0)``
representing stopped.
rBrEs <20>r2rDz Robot.valuess<00><><00><15>w<EFBFBD>w<EFBFBD>}<7D>r4c<00>8<00>|\|j_|j_dSr,)r<>rDr<>r<>s r2rDz Robot.value}s<00><00>8=<3D>5<><04><0F><1D>t<EFBFBD>/<2F>5<>5<>5r4rr)<02>
curve_left<EFBFBD> curve_rightc<00>4<00>d|cxkrdksntd<03><00><00>d|cxkrdksntd<04><00><00>|dkr|dkrtd<05><00><00>|j<00>|d|z
z<00><00>|j<00>|d|z
z<00><00>dS)a<>
Drive the robot forward by running both motors forward.
:param float speed:
Speed at which to drive the motors, as a value between 0 (stopped)
and 1 (full speed). The default is 1.
:param float curve_left:
The amount to curve left while moving forwards, by driving the
left motor at a slower speed. Maximum *curve_left* is 1, the
default is 0 (no curve). This parameter can only be specified as a
keyword parameter, and is mutually exclusive with *curve_right*.
:param float curve_right:
The amount to curve right while moving forwards, by driving the
right motor at a slower speed. Maximum *curve_right* is 1, the
default is 0 (no curve). This parameter can only be specified as a
keyword parameter, and is mutually exclusive with *curve_left*.
rr<00>"curve_left must be between 0 and 1<>#curve_right must be between 0 and 1<>9curve_left and curve_right can't be used at the same timeN)r<>r<><00>forwardr<64><00>r;<00>speedr<64>r<>s r2r<>z Robot.forward<72>s<><00><00>(<11>J<EFBFBD>#<23>#<23>#<23>#<23>!<21>#<23>#<23>#<23>#<23><1C>A<>B<>B<> B<><10>K<EFBFBD>$<24>$<24>$<24>$<24>1<EFBFBD>$<24>$<24>$<24>$<24><1C>B<>C<>C<> C<> <15><11>?<3F>?<3F>{<7B>a<EFBFBD>/<2F>/<2F><1C>-<2D>.<2E>.<2E> .<2E> <0C><0F><1F><1F><05><11>Z<EFBFBD><1E> 8<>9<>9<>9<> <0C><18> <20> <20><15>!<21>k<EFBFBD>/<2F>!:<3A>;<3B>;<3B>;<3B>;<3B>;r4c<00>4<00>d|cxkrdksntd<03><00><00>d|cxkrdksntd<04><00><00>|dkr|dkrtd<05><00><00>|j<00>|d|z
z<00><00>|j<00>|d|z
z<00><00>dS)a<>
Drive the robot backward by running both motors backward.
:param float speed:
Speed at which to drive the motors, as a value between 0 (stopped)
and 1 (full speed). The default is 1.
:param float curve_left:
The amount to curve left while moving backwards, by driving the
left motor at a slower speed. Maximum *curve_left* is 1, the
default is 0 (no curve). This parameter can only be specified as a
keyword parameter, and is mutually exclusive with *curve_right*.
:param float curve_right:
The amount to curve right while moving backwards, by driving the
right motor at a slower speed. Maximum *curve_right* is 1, the
default is 0 (no curve). This parameter can only be specified as a
keyword parameter, and is mutually exclusive with *curve_left*.
rrr<>r<>r<>N)r<>r<><00>backwardr<64>r<>s r2rzRobot.backward<72>s<><00><00>(<11>J<EFBFBD>#<23>#<23>#<23>#<23>!<21>#<23>#<23>#<23>#<23><1C>A<>B<>B<> B<><10>K<EFBFBD>$<24>$<24>$<24>$<24>1<EFBFBD>$<24>$<24>$<24>$<24><1C>B<>C<>C<> C<> <15><11>?<3F>?<3F>{<7B>a<EFBFBD>/<2F>/<2F><1C>-<2D>.<2E>.<2E> .<2E> <0C><0F> <20> <20><15>!<21>j<EFBFBD>.<2E>!9<>:<3A>:<3A>:<3A> <0C><18>!<21>!<21>%<25>1<EFBFBD>{<7B>?<3F>";<3B><<3C><<3C><<3C><<3C><r4c<00>n<00>|j<00>|<01><00>|j<00>|<01><00>dS)a 
Make the robot turn left by running the right motor forward and left
motor backward.
:param float speed:
Speed at which to drive the motors, as a value between 0 (stopped)
and 1 (full speed). The default is 1.
N)r<>r<>r<>r<00>r;r<>s r2r<>z
Robot.left<66>s7<00><00> <0A><18> <20> <20><15>'<27>'<27>'<27> <0C><0F> <20> <20><15>'<27>'<27>'<27>'<27>'r4c<00>n<00>|j<00>|<01><00>|j<00>|<01><00>dS)a 
Make the robot turn right by running the left motor forward and right
motor backward.
:param float speed:
Speed at which to drive the motors, as a value between 0 (stopped)
and 1 (full speed). The default is 1.
N)r<>r<>r<>rrs r2r<>z Robot.right<68>s7<00><00> <0A><0F><1F><1F><05>&<26>&<26>&<26> <0C><18>!<21>!<21>%<25>(<28>(<28>(<28>(<28>(r4c<00>j<00>|j<00><00><00>|j<00><00><00>dS)a6
Reverse the robot's current motor directions. If the robot is currently
running full speed forward, it will run full speed backward. If the
robot is turning left at half-speed, it will turn right at half-speed.
If the robot is currently stopped it will remain stopped.
N)r<><00>reverser<65>r}s r2rz Robot.reverse<73>s3<00><00> <0A><0F><1F><1F>!<21>!<21>!<21> <0C><18> <20> <20>"<22>"<22>"<22>"<22>"r4c<00>j<00>|j<00><00><00>|j<00><00><00>dS)z!
Stop the robot.
N)r<>r<>r<>r}s r2r<>z
Robot.stop<6F>s3<00><00> <0A><0F><1C><1C><1E><1E><1E> <0C><18><1D><1D><1F><1F><1F><1F>r4r<>)rIrJrKrLrprMrDrNr<>rr<>r<>rr<>rOrPs@r2r<>r<>4s<00><><00><00><00><00><00>$<08>$<08>J48<34>2<>2<>2<>2<>2<>2<>2<>2<0E><1D><1D><1D><1D><0E>X<EFBFBD><1D> <0B>\<5C>><3E>><3E><12>\<5C>><3E><<3C>Q<EFBFBD>A<EFBFBD><<3C><<3C><<3C><<3C><<3C><=<3D>a<EFBFBD>Q<EFBFBD>=<3D>=<3D>=<3D>=<3D>=<3D><
(<28>
(<28>
(<28>
(<28>
)<29>
)<29>
)<29>
)<29>#<23>#<23>#<23> <20> <20> <20> <20> <20> <20> r4r<>c<00>*<00><00>eZdZdZddd<04><02>fd<05>
Z<04>xZS)<06> RyanteckRobota<74>
Extends :class:`Robot` for the `Ryanteck motor controller board`_.
The Ryanteck MCB pins are fixed and therefore there's no need to specify
them when constructing this class. The following example drives the robot
forward::
from gpiozero import RyanteckRobot
robot = RyanteckRobot()
robot.forward()
:param bool pwm:
If :data:`True` (the default), construct :class:`PWMOutputDevice`
instances for the motor controller pins, allowing both direction and
variable speed control. If :data:`False`, construct
:class:`DigitalOutputDevice` instances, allowing only direction
control.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _Ryanteck motor controller board: https://uk.pi-supply.com/products/ryanteck-rtk-000-001-motor-controller-board-kit-raspberry-pi
TNr<4E>c <00><><00><01>t<00><00><00>tdd||<02><03><00>tdd||<02><03><00>|<02><06><00>dS)Nrkrwr<>rmrx<00>r<>r<>rY<00>rCrprr<>s <20>r2rpzRyanteckRobot.__init__ <00>Y<00><><00> <0A><07><07><18><18><16>y<EFBFBD>)<29><13>+<2B>N<>N<>N<><17> <09>9<EFBFBD>#<23>;<3B>O<>O<>O<>#<23> <19> %<25> %<25> %<25> %<25> %r4rgrPs@r2rr<00>sS<00><><00><00><00><00><00><08><08>6#<23><04>%<25>%<25>%<25>%<25>%<25>%<25>%<25>%<25>%<25>%<25>%r4rc<00>*<00><00>eZdZdZddd<04><02>fd<05>
Z<04>xZS)<06>CamJamKitRobota<74>
Extends :class:`Robot` for the `CamJam #3 EduKit`_ motor controller board.
The CamJam robot controller pins are fixed and therefore there's no need
to specify them when constructing this class. The following example drives
the robot forward::
from gpiozero import CamJamKitRobot
robot = CamJamKitRobot()
robot.forward()
:param bool pwm:
If :data:`True` (the default), construct :class:`PWMOutputDevice`
instances for the motor controller pins, allowing both direction and
variable speed control. If :data:`False`, construct
:class:`DigitalOutputDevice` instances, allowing only direction
control.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _CamJam #3 EduKit: http://camjam.me/?page_id=1035
TNr<4E>c <00><><00><01>t<00><00><00>tdd||<02><03><00>tdd||<02><03><00>|<02><06><00>dS)Nr<4E>r<>r<>r<>r<>r
r r<>s <20>r2rpzCamJamKitRobot.__init__% r r4rgrPs@r2rr
<00>S<00><><00><00><00><00><00><08><08>4#<23><04>%<25>%<25>%<25>%<25>%<25>%<25>%<25>%<25>%<25>%<25>%r4rc<00>*<00><00>eZdZdZddd<04><02>fd<05>
Z<04>xZS)<06>PololuDRV8835Robota<74>
Extends :class:`Robot` for the `Pololu DRV8835 Dual Motor Driver Kit`_.
The Pololu DRV8835 pins are fixed and therefore there's no need to specify
them when constructing this class. The following example drives the robot
forward::
from gpiozero import PololuDRV8835Robot
robot = PololuDRV8835Robot()
robot.forward()
:param bool pwm:
If :data:`True` (the default), construct :class:`PWMOutputDevice`
instances for the motor controller's enable pins, allowing both
direction and variable speed control. If :data:`False`, construct
:class:`DigitalOutputDevice` instances, allowing only direction
control.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _Pololu DRV8835 Dual Motor Driver Kit: https://www.pololu.com/product/2753
TNr<4E>c <00><><00><01>t<00><00><00>tdd||<02><03><00>tdd||<02><03><00>|<02><06><00>dS)Nr<4E><00>BOARD32r<32>r<>r<>r
)rCrpr r<>s <20>r2rpzPololuDRV8835Robot.__init__G sY<00><><00> <0A><07><07><18><18>!<21>)<29>Y<EFBFBD>C<EFBFBD>[<5B>Y<>Y<>Y<>"<22>9<EFBFBD>i<EFBFBD>S<EFBFBD>k<EFBFBD>Z<>Z<>Z<>#<23> <19> %<25> %<25> %<25> %<25> %r4rgrPs@r2rr, rr4rc<00>J<00><00>eZdZdd<02><01>fd<03>
Z<03>fd<04>Zed<05><00><00>Zd<06>Z<07>xZS)<07>_EnergenieMasterNr<4E>c<00><><00><01><01>t<00><00>|_t<00><00>j<00>fd<01>dD<00><00>t d<03><01><04><00>t d<05><01><04><00>d<06>d<07><04>dS)Nc3<00>:<00>K<00>|]}t|<01><02><00><00>V<00><00>dS)r<>Nr+)r]r^rYs <20>r2r_z,_EnergenieMaster.__init__.<locals>.<genexpr>R sD<00><><00><00><00><0E><0E><17><1D>S<EFBFBD>k<EFBFBD>:<3A>:<3A>:<3A><0E><0E><0E><0E><0E>r4)rkrmrxrlryr<>rz)<02>mode<64>enable)rrrXrY)r<00>_lockrCrpr)r;rYrFs `<60>r2rpz_EnergenieMaster.__init__O s<><00><><EFBFBD><00><19>V<EFBFBD>V<EFBFBD><04>
<EFBFBD><18><05><07><07><18><0E><0E><0E><0E>G<><0E><0E><0E><1E>i<EFBFBD>[<5B>A<>A<>A<><1F> <09>{<7B>C<>C<>C<>%<25>;<3B>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4c<00><><00><01>t|dd<00><00>r?|j5t<00><00><00><00><00>ddd<00><00>n #1swxYwYd|_dS)Nr)<04>getattrrrCr<>rEs <20>r2r<>z_EnergenieMaster.close[ s<><00><><00> <12>4<EFBFBD><17>$<24> '<27> '<27> <20><15><1A> <20> <20><15><07><07> <0A> <0A><0F><0F><0F> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20><><EFBFBD><EFBFBD> <20> <20> <20> <20><19><04>
<EFBFBD>
<EFBFBD>
s<00>!A<03>A <07>A c<00><00>dSr,rm)<02>clsrYs r2<00> _shared_keyz_EnergenieMaster._shared_keya s <00><00><14>tr4c<00><><00>|j5 dt|<02><00>zd|z
z}|dd<02>D]}|dz|_|dz}<03>td<04><00>|j<00><00><00>td<05><00>|j<00><00><00>n#|j<00><00><00>wxYw ddd<00><00>dS#1swxYwYdS)NrTr<>rg<><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?g<00>?)rr<>rDrrr9r>)r;<00>socketr<00>code<64>bits r2<00>transmitz_EnergenieMaster.transmitf s<00><00> <11>Z<EFBFBD>
"<22>
"<22> "<22><19>D<EFBFBD><16>L<EFBFBD>L<EFBFBD>(<28>Q<EFBFBD><16>Z<EFBFBD>8<><04><1F><02><11><02>8<EFBFBD><1F><1F>C<EFBFBD>!%<25><01><18>C<EFBFBD>I<EFBFBD><18>Q<EFBFBD>J<EFBFBD>D<EFBFBD>D<EFBFBD><15>c<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD><14> <0B><0E><0E> <20> <20> <20><15>d<EFBFBD> <0B> <0B> <0B><14> <0B><0F><0F>!<21>!<21>!<21>!<21><><04> <0B><0F><0F>!<21>!<21>!<21>!<21><><EFBFBD><EFBFBD>!<21>
"<22>
"<22>
"<22>
"<22>
"<22>
"<22>
"<22>
"<22>
"<22>
"<22>
"<22>
"<22><><EFBFBD><EFBFBD>
"<22>
"<22>
"<22>
"<22>
"<22>
"s)<00>B;<03>A+B<02>5B;<03>B*<05>*B;<03>;B?<07>B?) rIrJrKrpr<><00> classmethodr r%rOrPs@r2rrN s<><00><><00><00><00><00><00>&*<2A>

<EFBFBD>

<EFBFBD>

<EFBFBD>

<EFBFBD>

<EFBFBD>

<EFBFBD>

<EFBFBD><1A><1A><1A><1A><1A> <11><14><14><11>[<5B><14> "<22> "<22> "<22> "<22> "<22> "<22> "r4rc<00><><00><00>eZdZdZdddd<04><02>fd<05> Zd<06>Zed<07><00><00>Zd<08>Zed <09><00><00>Z ed
<EFBFBD><00><00>Z
e
j d <0B><00><00>Z
d <0C>Z d <0A>Z <0A>xZS)<0F> Energeniea<65>
Extends :class:`Device` to represent an `Energenie socket`_ controller.
This class is constructed with a socket number and an optional initial
state (defaults to :data:`False`, meaning off). Instances of this class can
be used to switch peripherals on and off. For example::
from gpiozero import Energenie
lamp = Energenie(1)
lamp.on()
:param int socket:
Which socket this instance should control. This is an integer number
between 1 and 4.
:type initial_value: bool or None
:param initial_value:
The initial state of the socket. As Energenie sockets provide no
means of reading their state, you may provide an initial state for
the socket, which will be set upon construction. This defaults to
:data:`False` which will switch the socket off.
Specifying :data:`None` will not set any initial state nor transmit any
control signal to the device.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _Energenie socket: https://energenie4u.co.uk/index.php/catalogue/product/ENER002-2PI
NF)r<>rYc<00>P<00><01>|<01>td<01><00><00>d|cxkrdksntd<04><00><00>d|_t<00><00><00>|<03><05><00>||_t |<03><05><00>|_|r|<00><00><00>dS|<02>|<00> <00><00>dSdS)Nzsocket number must be providedrr<>z%socket number must be between 1 and 4r<34>)
rrr8rCrp<00>_socketr<00>_masterr9r>)r;r"r<>rYrFs <20>r2rpzEnergenie.__init__<5F> s<><00><><00> <11>><3E>(<28>)I<>J<>J<> J<><11>V<EFBFBD> <20> <20> <20> <20>q<EFBFBD> <20> <20> <20> <20>$<24>%L<>M<>M<> M<><1A><04> <0B> <0A><07><07><18><18>[<5B><18>1<>1<>1<><1D><04> <0C>'<27>K<EFBFBD>@<40>@<40>@<40><04> <0C> <18> <17> <10>G<EFBFBD>G<EFBFBD>I<EFBFBD>I<EFBFBD>I<EFBFBD>I<EFBFBD>I<EFBFBD> <1A> &<26> <10>H<EFBFBD>H<EFBFBD>J<EFBFBD>J<EFBFBD>J<EFBFBD>J<EFBFBD>J<EFBFBD>'<27> &r4c<00>h<00>t|dd<00><00>r|j<00><00><00>d|_dS)Nr+)rr+r<>r}s r2r<>zEnergenie.close<73> s5<00><00> <12>4<EFBFBD><19>D<EFBFBD> )<29> )<29> !<21> <10>L<EFBFBD> <1E> <1E> <20> <20> <20><1B><04> <0C> <0C> r4c<00><00>|jduSr,)r+r}s r2<00>closedzEnergenie.closed<65> s<00><00><13>|<7C>t<EFBFBD>#<23>#r4c<00>d<00> |<00><00><00>d|j<00>d<02>S#t$rYdSwxYw)Nz%<gpiozero.Energenie object on socket <20>>z"<gpiozero.Energenie object closed>)<03> _check_openr*rr}s r2r<>zEnergenie.__repr__<5F> sP<00><00> 8<> <10> <1C> <1C> <1E> <1E> <1E>J<>4<EFBFBD><<3C>J<>J<>J<> J<><4A><1B> 8<> 8<> 8<>7<>7<>7<> 8<><38><EFBFBD>s <00>!<00>
/<03>/c<00><00>|jS)z,
Returns the socket number.
)r*r}s r2r"zEnergenie.socket<65> s <00><00>
<14>|<7C>r4c<00><00>|jS)ad
Returns :data:`True` if the socket is on and :data:`False` if the
socket is off. Setting this property changes the state of the socket.
Returns :data:`None` only when constructed with :data:`initial_value`
set to :data:`None` and neither :data:`on()` nor :data:`off()` have
been called since construction.
r7r}s r2rDzEnergenie.value<75> s <00><00><14>{<7B>r4c<00><><00>|<01>td<01><00><00>t|<01><00>}|j<00>|j|<01><00>||_dS)Nzvalue cannot be None)<06> TypeErrorr<72>r+r%r*r8r<>s r2rDzEnergenie.value<75> sF<00><00> <10>=<3D><1B>2<>3<>3<> 3<><14>U<EFBFBD> <0B> <0B><05> <0C> <0C><1D><1D>d<EFBFBD>l<EFBFBD>E<EFBFBD>2<>2<>2<><1B><04> <0B> <0B> r4c<00><00>d|_dS)z&
Turns the socket on.
TNr<4E>r}s r2r9z Energenie.on<6F> s<00><00><1A><04>
<EFBFBD>
<EFBFBD>
r4c<00><00>d|_dS)z'
Turns the socket off.
FNr<4E>r}s r2r>z Energenie.off<66> s<00><00><1B><04>
<EFBFBD>
<EFBFBD>
r4r,)rIrJrKrLrpr<>rMr.r<>r"rDrNr9r>rOrPs@r2r(r(t s<00><><00><00><00><00><00><08><08>@ <17>U<EFBFBD><04> <17> <17> <17> <17> <17> <17> <17><1C><1C><1C>
<0E>$<24>$<24><0E>X<EFBFBD>$<24>8<>8<>8<><0E><1C><1C><0E>X<EFBFBD><1C> <0E><1B><1B><0E>X<EFBFBD><1B> <0B>\<5C><1C><1C><12>\<5C><1C><1A><1A><1A> <1B><1B><1B><1B><1B><1B>r4r(c<00>,<00><00>eZdZdZdddd<04><03>fd<05>
Z<04>xZS)<06> PumpkinPia6
Extends :class:`LEDBoard` for the `ModMyPi PumpkinPi`_ board.
There are twelve LEDs connected up to individual pins, so for the PumpkinPi
the pins are fixed. For example::
from gpiozero import PumpkinPi
pumpkin = PumpkinPi(pwm=True)
pumpkin.sides.pulse()
pumpkin.off()
:param bool pwm:
If :data:`True`, construct :class:`PWMLED` instances to represent each
LED. If :data:`False` (the default), construct regular :class:`LED`
instances
:type initial_value: bool or None
:param initial_value:
If :data:`False` (the default), all LEDs will be off initially. If
:data:`None`, each device will be left in whatever state the pin is
found in when configured for output (warning: this can be on). If
:data:`True`, the device will be switched on initially.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _ModMyPi PumpkinPi: https://www.modmypi.com/halloween-pumpkin-programmable-kit
.. attribute:: sides
A :class:`LEDBoard` representing the LEDs around the edge of the
pumpkin. It contains:
.. attribute:: left, right
Two :class:`LEDBoard` instances representing the LEDs on the left
and right sides of the pumpkin. They each contain:
.. attribute:: top, midtop, middle, midbottom, bottom
Each :class:`LED` or :class:`PWMLED` around the specified side
of the pumpkin.
.. attribute:: eyes
A :class:`LEDBoard` representing the eyes of the pumpkin. It contains:
.. attribute:: left, right
The :class:`LED` or :class:`PWMLED` for each of the pumpkin's eyes.
FNrMc<00><><00><01>t<00><00><00>ttddddd||d|<03><07> <00> tdd d
d d ||d|<03><07> <00> ||d |<03><0E><00>tdd||d |<03><0E><00>||d|<03><12><00>dS)Nrwrkr<>r<>ry)r<><00> midbottomr<6D><00>midtopr<70>) r<>r;r<>r<r<>r<>r<>rXrYr<>r<>r<>rmrxr<>r<>rr<>)r<><00>sides)r=r<>r<>r<>rXrYr<>r<>s <20>r2rpzPumpkinPi.__init__
s<><00><><00> <0A><07><07><18><18><1A><1D>$<24> <09>)<29>$<24>)<29><1B>=<3D>M<> +<2B> -<2D>-<2D>-<2D> <1F>$<24> <09>)<29>$<24>)<29><1B>=<3D>M<> +<2B> -<2D>-<2D>-<2D> <18>}<7D>(<28>'<27><12><12><12>"<1A><1E>i<EFBFBD><17>}<7D>(<28>'<27> <12><12><12> <14>=<3D>$<24>#<23>5 <19>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4rgrPs@r2r9r9<00> sV<00><><00><00><00><00><00>5<08>5<08>l$<24>5<EFBFBD>d<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4r9c<00>><00><00>eZdZdZddd<04><02>fd<05>
Z<04>fd<06>Z<05>fd<07>Z<06>xZS)<08>JamHata<74>
Extends :class:`CompositeOutputDevice` for the `ModMyPi JamHat`_ board.
There are 6 LEDs, two buttons and a tonal buzzer. The pins are fixed.
Usage::
from gpiozero import JamHat
hat = JamHat()
hat.button_1.wait_for_press()
hat.lights_1.on()
hat.buzzer.play('C4')
hat.button_2.wait_for_press()
hat.off()
:param bool pwm:
If :data:`True`, construct :class:`PWMLED` instances to represent each
LED on the board. If :data:`False` (the default), construct regular
:class:`LED` instances.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _ModMyPi JamHat: https://thepihut.com/products/jam-hat
.. attribute:: lights_1, lights_2
Two :class:`LEDBoard` instances representing the top (lights_1) and
bottom (lights_2) rows of LEDs on the JamHat.
.. attribute:: red, yellow, green
:class:`LED` or :class:`PWMLED` instances representing the red,
yellow, and green LEDs along the top row.
.. attribute:: button_1, button_2
The left (button_1) and right (button_2) :class:`Button` objects on the
JamHat.
.. attribute:: buzzer
The :class:`TonalBuzzer` at the bottom right of the JamHat.
FNr<4E>c <00><00><01>t<00><00><00>tddd|d|<02><05><00>tddd|d|<02><05><00>td d
|<02> <0B><00>td d
|<02> <0B><00>t d |<02><0E><00>d|<02><10><00>dS)Nr<4E>rr<>)rnr<>ro)rnr<>ror<>rXrYr<>r<>rkr<>Fr<46>rwr<>r<>)<05>lights_1<5F>lights_2<5F>button_1<5F>button_2r<32>)rArBrCrDr<>rXrY)rCrpr<>rr!r<>s <20>r2rpzJamHat.__init__`
s<><00><><00> <0A><07><07><18><18><1D><1D>i<EFBFBD>y<EFBFBD><17> :<3A>'<27><0E><0E><0E>
<1E><1D>i<EFBFBD>y<EFBFBD><17> :<3A>'<27>)<29>)<29>)<29><1C>I<EFBFBD>u<EFBFBD>+<2B>N<>N<>N<><1B>I<EFBFBD>u<EFBFBD>+<2B>N<>N<>N<><1E>y<EFBFBD>k<EFBFBD>B<>B<>B<>M<>#<23> <19>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
r4c<00>`<00><01>d|j_t<00><00><00><00><00>dS<00>zO
Turns all the LEDs on and makes the buzzer play its mid tone.
rN<>r<>rDrCr9rEs <20>r2r9z JamHat.onr
<00>$<00><><00><1E><04> <0B><19> <0A><07><07>
<EFBFBD>
<EFBFBD> <0C> <0C> <0C> <0C> r4c<00>`<00><01>d|j_t<00><00><00><00><00>dS<00>z>
Turns all the LEDs off and stops the buzzer.
N<>r<>rDrCr>rEs <20>r2r>z
JamHat.offy
<00>$<00><><00>!<21><04> <0B><19> <0A><07><07> <0B> <0B> <0A> <0A> <0A> <0A> r4<00>rIrJrKrLrpr9r>rOrPs@r2r?r?0
s<><00><><00><00><00><00><00>.<08>.<08>^$<24><14>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>$<15><15><15><15><15><16><16><16><16><16><16><16><16>r4r?c<00>><00><00>eZdZdZddd<04><02>fd<05>
Z<04>fd<06>Z<05>fd<07>Z<06>xZS)<08>Pibrellaa<61>
Extends :class:`CompositeOutputDevice` for the Cyntech/Pimoroni `Pibrella`_
board.
The Pibrella board comprises 3 LEDs, a button, a tonal buzzer, four general
purpose input channels, and four general purpose output channels (with LEDs).
This class exposes the LEDs, button and buzzer.
Usage::
from gpiozero import Pibrella
pb = Pibrella()
pb.button.wait_for_press()
pb.lights.on()
pb.buzzer.play('A4')
pb.off()
The four input and output channels are exposed so you can create GPIO Zero
devices using these pins without looking up their respective pin numbers::
from gpiozero import Pibrella, LED, Button
pb = Pibrella()
btn = Button(pb.inputs.a, pull_up=False)
led = LED(pb.outputs.e)
btn.when_pressed = led.on
:param bool pwm:
If :data:`True`, construct :class:`PWMLED` instances to represent each
LED on the board, otherwise if :data:`False` (the default), construct
regular :class:`LED` instances.
:type pin_factory: Factory or None
:param pin_factory:
See :doc:`api_pins` for more information (this is an advanced feature
which most users can ignore).
.. _Pibrella: http://www.pibrella.com/
.. attribute:: lights
:class:`TrafficLights` instance representing the three LEDs
.. attribute:: red, amber, green
:class:`LED` or :class:`PWMLED` instances representing the red,
amber, and green LEDs
.. attribute:: button
The red :class:`Button` object on the Pibrella
.. attribute:: buzzer
A :class:`TonalBuzzer` object representing the buzzer
.. attribute:: inputs
A :func:`~collections.namedtuple` of the input pin numbers
.. attribute:: a, b, c, d
.. attribute:: outputs
A :func:`~collections.namedtuple` of the output pin numbers
.. attribute:: e, f, g, h
FNr<4E>c <00>N<00><01>t<00><00><00>tddd||<02><04><00>tdd|<02><07><00>t d|<02> <09><00>d
|<02> <0B><00>t d gd <0A><01><00>}t dgd<0F><01><00>}|dddd<13> <0A><00>|_|dddd<17><0F><00>|_dS)Nrlrkrv)rnr<>ror<>rYr<>Fr<46>rwr<>)r<>rzr<>)r<>rzr<>rXrY<00> InputPins)r0r1<00>crd<00>
OutputPins)<04>er<00>g<>hr<68>r<>r<>r<>rmrxryrz)rCrpr<>rr!r <00>inputs<74>outputs)r;r<>rYrQrSrFs <20>r2rpzPibrella.__init__<5F>
s<><00><><00> <0A><07><07><18><18> <20><1D>Y<EFBFBD>h<EFBFBD><17>[<5B><0E><0E><0E><1A>)<29>U<EFBFBD> <0B>L<>L<>L<><1E>y<EFBFBD>k<EFBFBD>B<>B<>B<>1<>#<23> <19>
<EFBFBD>
<EFBFBD>
<EFBFBD><1F>{<7B>,@<40>,@<40>,@<40>A<>A<> <09><1F> <0C>.B<>.B<>.B<>C<>C<>
<EFBFBD><1F>i<EFBFBD><17>9<EFBFBD> <09>Y<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD><04> <0B>"<22>z<EFBFBD><17>9<EFBFBD> <09>Y<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD><04> <0C> <0C> r4c<00>`<00><01>d|j_t<00><00><00><00><00>dSrFrGrEs <20>r2r9z Pibrella.on<6F>
rHr4c<00>`<00><01>d|j_t<00><00><00><00><00>dSrJrKrEs <20>r2r>z Pibrella.off<66>
rLr4rMrPs@r2rOrO<00>
s<><00><><00><00><00><00><00>G<08>G<08>P$<24><14>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>(<15><15><15><15><15><16><16><16><16><16><16><16><16>r4rO)NNTN)er<65><00>timer<00> itertoolsrrrr<00> threadingr<00> collectionsr r
r <00>collections.abcr <00>pprintr <00>importlib_resourcesr<00> ImportError<6F> importlib<69>excrrrrrrrr<00> input_devicesr<00>output_devicesrrrrrrr r!<00>threadsr"r<>r#r$<00>mixinsr%r&r'r(<00>fontsr)r*r3r6rRri<00>
is_pressed<EFBFBD> active_time<6D> pressed_time<6D>when_activated<65> when_pressed<65>when_deactivated<65> when_released<65>wait_for_active<76>wait_for_press<73>wait_for_inactive<76>wait_for_releaser<65><00>is_litr<74>r<>r<>r r(rLrirsr~r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>rrrrr(r9r?rOrmr4r2<00><module>rvst<00><01>(<10><0F><0F><0F><16><16><16><16><16><16>/<2F>/<2F>/<2F>/<2F>/<2F>/<2F>/<2F>/<2F>/<2F>/<2F>/<2F>/<2F><1A><1A><1A><1A><1A><1A>8<>8<>8<>8<>8<>8<>8<>8<>8<>8<>*<2A>*<2A>*<2A>*<2A>*<2A>*<2A><1A><1A><1A><1A><1A><1A>$<24>+<2B>+<2B>+<2B>+<2B>+<2B><><12>$<24>$<24>$<24>#<23>#<23>#<23>#<23>#<23>#<23>#<23>#<23>$<24><><EFBFBD><EFBFBD> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06>"<22>!<21>!<21>!<21>!<21>!<21> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <06> <20><1F><1F><1F><1F><1F>,<2C>,<2C>,<2C>,<2C>,<2C>,<2C>,<2C>,<2C>><3E>><3E>><3E>><3E>><3E>><3E>><3E>><3E>><3E>><3E>><3E>><3E>2<>2<>2<>2<>2<>2<>2<>2<><15><15><15> E!<21>E!<21>E!<21>E!<21>E!<21>K<EFBFBD><1F>E!<21>E!<21>E!<21>RG!<21>G!<21>G!<21>G!<21>G!<21>)<29>_<EFBFBD>G!<21>G!<21>G!<21>R%<25>.<2E> <0B><16>&<26>2<> <0B><18>&<26>5<> <0B><18>'<27>8<> <0B><19>(<28>8<> <0B><1A>*<2A><<3C> <0B><1C>3#<23>3#<23>3#<23>3#<23>3#<23>)<29>3#<23>3#<23>3#<23>l%<25>.<2E> <0A><14>M<16>M<16>M<16>M<16>M<16>}<7D>M<16>M<16>M<16>`F'<27>F'<27>F'<27>F'<27>F'<27>-<2D>F'<27>F'<27>F'<27>RY<1A>Y<1A>Y<1A>Y<1A>Y<1A>.<2E>Y<1A>Y<1A>Y<1A>xN%<25>N%<25>N%<25>N%<25>N%<25>]<5D>N%<25>N%<25>N%<25>b{<16>{<16>{<16>{<16>{<16>/<2F>{<16>{<16>{<16>|R
<EFBFBD>R
<EFBFBD>R
<EFBFBD>R
<EFBFBD>R
<EFBFBD>H<EFBFBD>R
<EFBFBD>R
<EFBFBD>R
<EFBFBD>j#
<EFBFBD>#
<EFBFBD>#
<EFBFBD>#
<EFBFBD>#
<EFBFBD>f<EFBFBD>#
<EFBFBD>#
<EFBFBD>#
<EFBFBD>L&
<EFBFBD>&
<EFBFBD>&
<EFBFBD>&
<EFBFBD>&
<EFBFBD>h<EFBFBD>&
<EFBFBD>&
<EFBFBD>&
<EFBFBD>R#
<EFBFBD>#
<EFBFBD>#
<EFBFBD>#
<EFBFBD>#
<EFBFBD>k<EFBFBD>#
<EFBFBD>#
<EFBFBD>#
<EFBFBD>La)<29>a)<29>a)<29>a)<29>a)<29>H<EFBFBD>a)<29>a)<29>a)<29>H(
<EFBFBD>(
<EFBFBD>(
<EFBFBD>(
<EFBFBD>(
<EFBFBD> <0A>(
<EFBFBD>(
<EFBFBD>(
<EFBFBD>V7%<25>7%<25>7%<25>7%<25>7%<25>]<5D>7%<25>7%<25>7%<25>tT
<EFBFBD>T
<EFBFBD>T
<EFBFBD>T
<EFBFBD>T
<EFBFBD><18>T
<EFBFBD>T
<EFBFBD>T
<EFBFBD>nd
<EFBFBD>d
<EFBFBD>d
<EFBFBD>d
<EFBFBD>d
<EFBFBD>'<27>d
<EFBFBD>d
<EFBFBD>d
<EFBFBD>NV
<EFBFBD>V
<EFBFBD>V
<EFBFBD>V
<EFBFBD>V
<EFBFBD>X<EFBFBD>V
<EFBFBD>V
<EFBFBD>V
<EFBFBD>r%
<EFBFBD>%
<EFBFBD>%
<EFBFBD>%
<EFBFBD>%
<EFBFBD>/<2F>%
<EFBFBD>%
<EFBFBD>%
<EFBFBD>P$
<EFBFBD>$
<EFBFBD>$
<EFBFBD>$
<EFBFBD>$
<EFBFBD>$<24>$
<EFBFBD>$
<EFBFBD>$
<EFBFBD>N%
<EFBFBD>%
<EFBFBD>%
<EFBFBD>%
<EFBFBD>%
<EFBFBD>&<26>%
<EFBFBD>%
<EFBFBD>%
<EFBFBD>P%
<EFBFBD>%
<EFBFBD>%
<EFBFBD>%
<EFBFBD>%
<EFBFBD>-<2D>%
<EFBFBD>%
<EFBFBD>%
<EFBFBD>P<0F><0F><0F><0F>"p <20>p <20>p <20>p <20>p <20>K<EFBFBD><1F>p <20>p <20>p <20>f %<25> %<25> %<25> %<25> %<25>E<EFBFBD> %<25> %<25> %<25>F%<25>%<25>%<25>%<25>%<25>U<EFBFBD>%<25>%<25>%<25>D%<25>%<25>%<25>%<25>%<25><15>%<25>%<25>%<25>D#"<22>#"<22>#"<22>#"<22>#"<22>{<7B>$9<>#"<22>#"<22>#"<22>Lc<1B>c<1B>c<1B>c<1B>c<1B> <0B>V<EFBFBD>c<1B>c<1B>c<1B>LS
<EFBFBD>S
<EFBFBD>S
<EFBFBD>S
<EFBFBD>S
<EFBFBD><08>S
<EFBFBD>S
<EFBFBD>S
<EFBFBD>lN<16>N<16>N<16>N<16>N<16> "<22>N<16>N<16>N<16>bi<16>i<16>i<16>i<16>i<16>$<24>i<16>i<16>i<16>i<16>is<00>9<00> A<03>A