Skip to content

Commit 65748ca

Browse files
jaguilarlaurensvalk
authored andcommitted
pybricks.common.Motor: Specify geartrain order.
1 parent 1194f6c commit 65748ca

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/pybricks/_common.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,15 +390,18 @@ def __init__(
390390
turn when you give a positive speed value or
391391
angle.
392392
gears (list):
393-
List of gears linked to the motor.
393+
List of gears linked to the motor. The gear connected
394+
to the motor comes first and the gear connected to the output
395+
comes last.
394396
395397
For example: ``[12, 36]`` represents a gear train with a
396-
12-tooth and a 36-tooth gear. Use a list of lists for multiple
398+
12-tooth gear connected to the motor and a 36-tooth gear
399+
connected to the output. Use a list of lists for multiple
397400
gear trains, such as ``[[12, 36], [20, 16, 40]]``.
398401
399402
When you specify a gear train, all motor commands and settings
400403
are automatically adjusted to account for the resulting gear
401-
ratio. The motor direction remains unchanged by this.
404+
ratio. The motor direction remains unchanged by this.
402405
reset_angle (bool):
403406
Choose ``True`` to reset the rotation sensor value to the
404407
absolute marker angle (between -180 and 179).

src/pybricks/pupdevices.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,18 @@ def __init__(
5555
turn when you give a positive speed value or
5656
angle.
5757
gears (list):
58-
List of gears linked to the motor.
58+
List of gears linked to the motor. The gear connected
59+
to the motor comes first and the gear connected to the output
60+
comes last.
5961
6062
For example: ``[12, 36]`` represents a gear train with a
61-
12-tooth and a 36-tooth gear. Use a list of lists for multiple
63+
12-tooth gear connected to the motor and a 36-tooth gear
64+
connected to the output. Use a list of lists for multiple
6265
gear trains, such as ``[[12, 36], [20, 16, 40]]``.
6366
6467
When you specify a gear train, all motor commands and settings
6568
are automatically adjusted to account for the resulting gear
66-
ratio. The motor direction remains unchanged by this.
69+
ratio. The motor direction remains unchanged by this.
6770
reset_angle (bool):
6871
Choose ``True`` to reset the rotation sensor value to the
6972
absolute marker angle (between -180 and 179).
@@ -124,12 +127,10 @@ def __init__(self, name: Optional[str] = None, timeout: int = 10000):
124127
"""
125128

126129
@overload
127-
def name(self, name: str) -> None:
128-
...
130+
def name(self, name: str) -> None: ...
129131

130132
@overload
131-
def name(self) -> str:
132-
...
133+
def name(self) -> str: ...
133134

134135
def name(self, *args):
135136
"""name(name)

0 commit comments

Comments
 (0)