doc/parameters/Direction: move doc to rst

This commit is contained in:
Laurens Valk
2021-02-14 18:44:25 +01:00
parent e7dc4bb609
commit 0082f0502a
2 changed files with 21 additions and 20 deletions
+17 -2
View File
@@ -1,8 +1,23 @@
Direction
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: pybricks.parameters.Direction
:no-members:
.. 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,
+4 -18
View File
@@ -111,27 +111,13 @@ class Stop(_PybricksEnum):
class Direction(_PybricksEnum):
"""Rotational direction for positive speed or angle values.
.. data:: CLOCKWISE
A positive speed value should make the motor move clockwise.
.. data:: COUNTERCLOCKWISE
A positive speed value should make the motor move counterclockwise.
+--------------------------------+-------------------+-----------------+
| ``positive_direction =`` | Positive speed: | Negative speed: |
+================================+===================+=================+
| ``Direction.CLOCKWISE`` | clockwise | counterclockwise|
+--------------------------------+-------------------+-----------------+
| ``Direction.COUNTERCLOCKWISE`` | counterclockwise | clockwise |
+--------------------------------+-------------------+-----------------+
"""
"""Rotational direction for positive speed or angle values."""
CLOCKWISE = 0
"""A positive speed value should make the motor move clockwise."""
COUNTERCLOCKWISE = 1
"""A positive speed value should make the motor move counterclockwise."""
class Button(_PybricksEnum):