diff --git a/doc/api/hubs.rst b/doc/api/hubs.rst index 0c7173d..03a3cfa 100644 --- a/doc/api/hubs.rst +++ b/doc/api/hubs.rst @@ -3,6 +3,8 @@ .. module:: pybricks.hubs +.. _fig_hubs: + Select your programmable hub using the buttons below. .. content-tabs:: diff --git a/doc/api/parameters.rst b/doc/api/parameters.rst index 491682b..aecb12d 100644 --- a/doc/api/parameters.rst +++ b/doc/api/parameters.rst @@ -47,6 +47,15 @@ .. autoclass:: pybricks.parameters.Direction :no-members: + In general, clockwise is defined by **looking at the motor shaft, just + like looking at a clock**. + + Some motors have two shafts. If in doubt, refer to the following diagrams: + + - Clockwise direction for :ref:`EV3/NXT motors ` + - Clockwise direction for :ref:`Powered Up Motors ` + - Clockwise direction for :ref:`Move Hub Motors ` + .. autoclass:: pybricks.parameters.Stop :no-members: diff --git a/pybricks/parameters.py b/pybricks/parameters.py index ade3144..148aa66 100644 --- a/pybricks/parameters.py +++ b/pybricks/parameters.py @@ -107,8 +107,7 @@ class Stop(_PybricksEnum): class Direction(_PybricksEnum): - """Rotational direction for positive speed values: clockwise or - counterclockwise. + """Rotational direction for positive speed or angle values. .. data:: CLOCKWISE @@ -118,51 +117,13 @@ class Direction(_PybricksEnum): A positive speed value should make the motor move counterclockwise. - For all motors, this is defined when looking at the shaft, just like - looking at a clock. - - For NXT or EV3 motors, make sure to look at the motor with the red/orange - shaft to the lower right. - - +----------------------------+-------------------+-----------------+ - | Parameter | Positive speed | Negative speed | - +============================+===================+=================+ - | Direction.CLOCKWISE | clockwise | counterclockwise| - +----------------------------+-------------------+-----------------+ - | Direction.COUNTERCLOCKWISE | counterclockwise | clockwise | - +----------------------------+-------------------+-----------------+ - - :: - - - Medium EV3 Motor: - - - counterclockwise clockwise - ____ _____ - / \\ - / _____________ \\ - / / \\ \\ - | | _ | | - | | __| |__ | | - v | |__ o __| | v - | |_| | - | | - \\______________/ - - - Large EV3 Motor: - - ________ - / \\ ___ ___ - _| \\ / \\ - | ----/------ \\ - counterclockwise | __\\__ | clockwise - \\ __________ v / \\ v - -------| + | - \\_____/ - - + +--------------------------------+-------------------+-----------------+ + | ``positive_direction =`` | Positive speed: | Negative speed: | + +================================+===================+=================+ + | ``Direction.CLOCKWISE`` | clockwise | counterclockwise| + +--------------------------------+-------------------+-----------------+ + | ``Direction.COUNTERCLOCKWISE`` | counterclockwise | clockwise | + +--------------------------------+-------------------+-----------------+ """ CLOCKWISE = 0