mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-15 11:04:55 +00:00
49 lines
1.2 KiB
ReStructuredText
49 lines
1.2 KiB
ReStructuredText
Technic Hub
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
.. figure:: ../../api/images/technichub.png
|
|
:height: 15 em
|
|
|
|
.. autoclass:: pybricks.hubs.TechnicHub
|
|
:no-members:
|
|
|
|
.. rubric:: Using the hub status light
|
|
|
|
.. toggle-header::
|
|
:header: **Show/hide examples**
|
|
|
|
**Example 1: Turning the light on and off**
|
|
|
|
.. literalinclude::
|
|
../../../examples/pup/hub_technichub/light_off.py
|
|
|
|
**Example 2: Changing brightness and using custom colors**
|
|
|
|
.. literalinclude::
|
|
../../../examples/pup/hub_technichub/light_hsv.py
|
|
|
|
**Example 3: Making the light blink**
|
|
|
|
.. literalinclude::
|
|
../../../examples/pup/hub_technichub/light_blink.py
|
|
|
|
**Example 4: Creating light animations**
|
|
|
|
.. literalinclude::
|
|
../../../examples/pup/hub_technichub/light_animate.py
|
|
|
|
.. automethod:: pybricks.hubs::TechnicHub.light.on
|
|
|
|
.. automethod:: pybricks.hubs::TechnicHub.light.off
|
|
|
|
.. automethod:: pybricks.hubs::TechnicHub.light.blink
|
|
|
|
.. automethod:: pybricks.hubs::TechnicHub.light.animate
|
|
|
|
.. rubric:: Using the battery
|
|
|
|
.. automethod:: pybricks.hubs::TechnicHub.battery.voltage
|
|
|
|
.. automethod:: pybricks.hubs::TechnicHub.battery.current
|
|
|