mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-07-27 19:57:02 +00:00
parameters: revert CCW change
This reverts b560a545874271ee5f1de2b8f2c42456b06e2aa2 and adds uppercasing
This commit is contained in:
@@ -13,12 +13,12 @@ class Motor():
|
||||
* 45503 or 45502: Separate part (2013)
|
||||
"""
|
||||
|
||||
def __init__(self, port, direction=Direction.CW, gears=None):
|
||||
"""Motor(port, direction=Direction.CW, gears=None)
|
||||
def __init__(self, port, direction=Direction.CLOCKWISE, gears=None):
|
||||
"""Motor(port, direction=Direction.CLOCKWISE, gears=None)
|
||||
|
||||
Arguments:
|
||||
port (Port): Port to which the motor is connected.
|
||||
direction (Direction): Positive speed direction (*Default*: Direction.CW).
|
||||
direction (Direction): Positive speed direction (*Default*: Direction.CLOCKWISE).
|
||||
gears (list): List of gears linked to the motor (*Default*: ``None``).
|
||||
|
||||
For example: ``[12, 36]`` represents a gear train with a 12-tooth and a 36-tooth gear. See :ref:`ratio` for illustrated examples.
|
||||
@@ -39,10 +39,10 @@ class Motor():
|
||||
example_motor = Motor(Port.A)
|
||||
|
||||
# Initialize a motor where positive speed values should go counterclockwise
|
||||
right_motor = Motor(Port.B, Direction.CCW)
|
||||
right_motor = Motor(Port.B, Direction.COUNTERCLOCKWISE)
|
||||
|
||||
# Initialize a motor with a gear train
|
||||
robot_arm = Motor(Port.C, Direction.CW, [12, 36])
|
||||
robot_arm = Motor(Port.C, Direction.CLOCKWISE, [12, 36])
|
||||
"""
|
||||
pass
|
||||
|
||||
@@ -407,11 +407,11 @@ class GyroSensor():
|
||||
"""
|
||||
|
||||
def __init__(self, port):
|
||||
"""GyroSensor(port, direction=Direction.CW)
|
||||
"""GyroSensor(port, direction=Direction.CLOCKWISE)
|
||||
|
||||
Arguments:
|
||||
port (Port): Port to which the sensor is connected.
|
||||
direction (Direction): Positive rotation direction when looking at the red dot on top of the sensor (*Default*: Direction.CW).
|
||||
direction (Direction): Positive rotation direction when looking at the red dot on top of the sensor (*Default*: Direction.CLOCKWISE).
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
+11
-11
@@ -96,11 +96,11 @@ class Stop(Enum):
|
||||
class Direction():
|
||||
"""Rotational direction for positive speed values: clockwise or counterclockwise.
|
||||
|
||||
.. data:: CW
|
||||
.. data:: CLOCKWISE
|
||||
|
||||
A positive speed value should make the motor move clockwise.
|
||||
|
||||
.. data:: CCW
|
||||
.. data:: COUNTERCLOCKWISE
|
||||
|
||||
A positive speed value should make the motor move counterclockwise.
|
||||
|
||||
@@ -108,13 +108,13 @@ class Direction():
|
||||
|
||||
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.CW | clockwise | counterclockwise |
|
||||
+-------------------+-------------------+------------------+
|
||||
| Direction.CCW | counterclockwise | clockwise |
|
||||
+-------------------+-------------------+------------------+
|
||||
+----------------------------+-------------------+-----------------+
|
||||
| Parameter | Positive speed | Negative speed |
|
||||
+============================+===================+=================+
|
||||
| Direction.CLOCKWISE | clockwise | counterclockwise|
|
||||
+----------------------------+-------------------+-----------------+
|
||||
| Direction.COUNTERCLOCKWISE | counterclockwise | clockwise |
|
||||
+----------------------------+-------------------+-----------------+
|
||||
|
||||
::
|
||||
|
||||
@@ -149,8 +149,8 @@ class Direction():
|
||||
|
||||
"""
|
||||
|
||||
CW = 0
|
||||
CCW = 1
|
||||
CLOCKWISE = 0
|
||||
COUNTERCLOCKWISE = 1
|
||||
|
||||
|
||||
class Button(Enum):
|
||||
|
||||
Reference in New Issue
Block a user