Files
pybricks-api/doc/main/parameters/direction.rst
T
Laurens Valk 238204d280 doc/main: Rename from doc/api.
The doc/api is a legacy name, which is confusing in the current use, since all build targets are now APIs.

Today we have:

doc/common: Common configuration and settings between all targets.

doc/main: Main Pybricks documentation at docs.pybricks.com.

doc/ide: Documentation shipped with the Pybricks Code IDE.
2021-07-14 11:39:20 +02:00

25 lines
1.0 KiB
ReStructuredText

Direction
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. 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.