From 1e7991f68d42e90e1acf97a5dc090762e6fcc97b Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Sun, 25 Oct 2020 21:20:14 +0100 Subject: [PATCH] doc/inventorhub: expose hub in the docs --- doc/api/hubs/index.rst | 9 +++++++ doc/api/hubs/inventorhub.rst | 48 ++++++++++++++++++++++++++++++++++++ pybricks-projects | 2 +- 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 doc/api/hubs/inventorhub.rst diff --git a/doc/api/hubs/index.rst b/doc/api/hubs/index.rst index e2ee3c6..c6d56ae 100644 --- a/doc/api/hubs/index.rst +++ b/doc/api/hubs/index.rst @@ -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 diff --git a/doc/api/hubs/inventorhub.rst b/doc/api/hubs/inventorhub.rst new file mode 100644 index 0000000..b3139d7 --- /dev/null +++ b/doc/api/hubs/inventorhub.rst @@ -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 + diff --git a/pybricks-projects b/pybricks-projects index fa5a3f5..da28bf8 160000 --- a/pybricks-projects +++ b/pybricks-projects @@ -1 +1 @@ -Subproject commit fa5a3f5ecc9fff20c5862599d821cccaddc2a8ba +Subproject commit da28bf87876548d8dd19e74c60ea35eea334143c