doc/inventorhub: expose hub in the docs

This commit is contained in:
Laurens Valk
2020-10-25 21:31:05 +01:00
parent b29dab4d6b
commit 1e7991f68d
3 changed files with 58 additions and 1 deletions
+9
View File
@@ -11,6 +11,7 @@
cityhub
technichub
primehub
inventorhub
ev3brick
.. figure:: ../images/movehub.png
@@ -45,6 +46,14 @@
:no-members:
:noindex:
.. figure:: ../images/inventorhub.png
:height: 8 em
:target: inventorhub.html
.. autoclass:: pybricks.hubs.InventorHub
:no-members:
:noindex:
.. figure:: ../images/ev3brick.png
:height: 8 em
:target: ev3brick.html
+48
View File
@@ -0,0 +1,48 @@
MINDSTORMS Inventor Hub
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. figure:: ../../api/images/inventorhub.png
:height: 15 em
.. autoclass:: pybricks.hubs.InventorHub
:no-members:
.. rubric:: Using the hub status light
.. toggle-header::
:header: **Show/hide examples**
**Example 1: Turning the light on and off**
.. literalinclude::
../../../pybricks-projects/snippets/pup/hub_inventorhub/light_off.py
**Example 2: Changing brightness and using custom colors**
.. literalinclude::
../../../pybricks-projects/snippets/pup/hub_inventorhub/light_hsv.py
**Example 3: Making the light blink**
.. literalinclude::
../../../pybricks-projects/snippets/pup/hub_inventorhub/light_blink.py
**Example 4: Creating light animations**
.. literalinclude::
../../../pybricks-projects/snippets/pup/hub_inventorhub/light_animate.py
.. automethod:: pybricks.hubs::InventorHub.light.on
.. automethod:: pybricks.hubs::InventorHub.light.off
.. automethod:: pybricks.hubs::InventorHub.light.blink
.. automethod:: pybricks.hubs::InventorHub.light.animate
.. rubric:: Using the battery
.. automethod:: pybricks.hubs::InventorHub.battery.voltage
.. automethod:: pybricks.hubs::InventorHub.battery.current