Files
pybricks-api/doc/main/parameters/direction.rst
T
Laurens Valk 5ecad4a845 pybricks.parameters. Document with full namespace.
This types them in full for the object index.
2026-06-01 15:18:09 +02:00

29 lines
1.1 KiB
ReStructuredText

.. pybricks-requirements::
Direction
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. currentmodule:: pybricks.parameters
.. class:: Direction
Rotational direction for positive speed or angle values.
.. autoattribute:: pybricks.parameters.Direction.CLOCKWISE
:annotation:
.. autoattribute:: pybricks.parameters.Direction.COUNTERCLOCKWISE
:annotation:
+--------------------------------+-------------------+-----------------+
| ``positive_direction =`` | Positive speed: | Negative speed: |
+================================+===================+=================+
| ``Direction.CLOCKWISE`` | clockwise | counterclockwise|
+--------------------------------+-------------------+-----------------+
| ``Direction.COUNTERCLOCKWISE`` | counterclockwise | clockwise |
+--------------------------------+-------------------+-----------------+
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 diagram in the ``Motor`` class documentation.