doc/hubs: InventorHub and PrimeHub on same page

Make it a bit more explicit that they are the same.
This commit is contained in:
Laurens Valk
2021-01-19 11:18:21 +01:00
parent 5ab71de988
commit 7d40e07dfb
6 changed files with 14 additions and 168 deletions
-1
View File
@@ -11,7 +11,6 @@
cityhub
technichub
primehub
inventorhub
ev3brick
.. class:: MoveHub
-158
View File
@@ -1,158 +0,0 @@
MINDSTORMS Inventor Hub
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. figure:: ../../api/images/inventorhub.png
:height: 15 em
This class is identical to the
:class:`PrimeHub <pybricks.hubs.PrimeHub>` class, except
for the name.
.. autoclass:: pybricks.hubs.InventorHub
:no-members:
.. rubric:: Using the hub status light
.. figure:: ../../api/images/primehub_light_label.png
:width: 22 em
.. 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 light matrix display
.. figure:: ../../api/images/primehub_display_label.png
:width: 22 em
.. automethod:: pybricks.hubs::InventorHub.display.orientation
.. automethod:: pybricks.hubs::InventorHub.display.off
.. automethod:: pybricks.hubs::InventorHub.display.pixel
.. automethod:: pybricks.hubs::InventorHub.display.image
.. automethod:: pybricks.hubs::InventorHub.display.animate
.. automethod:: pybricks.hubs::InventorHub.display.number
.. automethod:: pybricks.hubs::InventorHub.display.char
.. automethod:: pybricks.hubs::InventorHub.display.text
.. rubric:: Using the buttons
.. figure:: ../../api/images/primehub_buttons_label.png
:width: 22 em
.. automethod:: pybricks.hubs::InventorHub.buttons.pressed
.. rubric:: Using the IMU
.. automethod:: pybricks.hubs::InventorHub.imu.acceleration
.. automethod:: pybricks.hubs::InventorHub.imu.gyro
.. rubric:: Using the speaker
.. automethod:: pybricks.hubs::InventorHub.speaker.beep
.. automethod:: pybricks.hubs::InventorHub.speaker.play_notes
.. rubric:: Using the battery
.. automethod:: pybricks.hubs::InventorHub.battery.voltage
.. automethod:: pybricks.hubs::InventorHub.battery.current
Status light examples
---------------------
Turning the light on and off
****************************
.. literalinclude::
../../../examples/pup/hub_inventorhub/light_off.py
Changing brightness and using custom colors
*******************************************
.. literalinclude::
../../../examples/pup/hub_inventorhub/light_hsv.py
Making the light blink
**********************
.. literalinclude::
../../../examples/pup/hub_inventorhub/light_blink.py
Creating light animations
*************************
.. literalinclude::
../../../examples/pup/hub_inventorhub/light_animate.py
Matrix display examples
-----------------------
Displaying images
*****************
.. literalinclude::
../../../examples/pup/hub_inventorhub/display_image.py
Displaying numbers
******************
.. literalinclude::
../../../examples/pup/hub_inventorhub/display_number.py
Displaying text
***************
.. literalinclude::
../../../examples/pup/hub_inventorhub/display_text.py
Displaying individual pixels
****************************
.. literalinclude::
../../../examples/pup/hub_inventorhub/display_pixel.py
Changing the display orientation
********************************
.. literalinclude::
../../../examples/pup/hub_inventorhub/display_orientation.py
Making your own images
**********************
.. literalinclude::
../../../examples/pup/hub_inventorhub/display_matrix.py
Combining images to make expressions
************************************
.. literalinclude::
../../../examples/pup/hub_inventorhub/display_expression.py
Displaying animations
*********************
.. literalinclude::
../../../examples/pup/hub_inventorhub/display_animate.py
Button examples
---------------
Detecting button presses
************************
.. literalinclude::
../../../examples/pup/hub_inventorhub/button_main.py
+13 -6
View File
@@ -1,12 +1,15 @@
SPIKE Prime Hub
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Prime Hub / Inventor Hub
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. figure:: ../../api/images/primehub.png
.. figure:: ../../api/images/primeinventorhub.png
:height: 15 em
This class is identical to the
:class:`PrimeHub <pybricks.hubs.PrimeHub>` class, except
for the name.
.. class:: InventorHub
This class is the same as the ``PrimeHub`` class, shown below. Both classes
work on both hubs.
These hubs are completely identical. They use the same Pybricks firmware.
.. autoclass:: pybricks.hubs.PrimeHub
:no-members:
@@ -70,6 +73,10 @@ for the name.
.. automethod:: pybricks.hubs::PrimeHub.battery.current
.. note:: The examples below use the ``PrimeHub`` class. The examples work fine
on both hubs because they are the identical. If you prefer, you can
change this to ``InventorHub``.
Status light examples
---------------------
-1
View File
@@ -11,7 +11,6 @@
cityhub
technichub
primehub
inventorhub
.. class:: MoveHub
:noindex:
-1
View File
@@ -1 +0,0 @@
.. include:: ../../api/hubs/inventorhub.rst
+1 -1
View File
@@ -73,7 +73,7 @@ class TechnicHub:
class PrimeHub:
"""LEGO® SPIKE Prime Hub."""
"""LEGO® SPIKE Prime Hub or LEGO® MINDSTORMS Inventor Hub."""
# These class attributes are here for auto-documentation only.
# In reality, they are instance attributes created by __init__.