mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 01:24:17 +00:00
Now that each hub is on its own page, we no longer need to collapse snippets to reduce page size. Now they can just all be at the bottom of the page. This also gives each a dedicated link which is easier when giving support.
52 lines
1.2 KiB
ReStructuredText
52 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
|
|
|
|
.. 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
|
|
|
|
Status light examples
|
|
---------------------
|
|
|
|
Turning the light on and off
|
|
****************************
|
|
|
|
.. literalinclude::
|
|
../../../examples/pup/hub_technichub/light_off.py
|
|
|
|
Changing brightness and using custom colors
|
|
*******************************************
|
|
|
|
.. literalinclude::
|
|
../../../examples/pup/hub_technichub/light_hsv.py
|
|
|
|
Making the light blink
|
|
**********************
|
|
|
|
.. literalinclude::
|
|
../../../examples/pup/hub_technichub/light_blink.py
|
|
|
|
Creating light animations
|
|
*************************
|
|
|
|
.. literalinclude::
|
|
../../../examples/pup/hub_technichub/light_animate.py
|