Skip to content

Commit

Permalink
pybricks.common.Motor: Specify geartrain order.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaguilar authored and laurensvalk committed Mar 11, 2024
1 parent 1194f6c commit 65748ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
9 changes: 6 additions & 3 deletions src/pybricks/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,15 +390,18 @@ def __init__(
turn when you give a positive speed value or
angle.
gears (list):
List of gears linked to the motor.
List of gears linked to the motor. The gear connected
to the motor comes first and the gear connected to the output
comes last.
For example: ``[12, 36]`` represents a gear train with a
12-tooth and a 36-tooth gear. Use a list of lists for multiple
12-tooth gear connected to the motor and a 36-tooth gear
connected to the output. Use a list of lists for multiple
gear trains, such as ``[[12, 36], [20, 16, 40]]``.
When you specify a gear train, all motor commands and settings
are automatically adjusted to account for the resulting gear
ratio. The motor direction remains unchanged by this.
ratio. The motor direction remains unchanged by this.
reset_angle (bool):
Choose ``True`` to reset the rotation sensor value to the
absolute marker angle (between -180 and 179).
Expand Down
15 changes: 8 additions & 7 deletions src/pybricks/pupdevices.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,18 @@ def __init__(
turn when you give a positive speed value or
angle.
gears (list):
List of gears linked to the motor.
List of gears linked to the motor. The gear connected
to the motor comes first and the gear connected to the output
comes last.
For example: ``[12, 36]`` represents a gear train with a
12-tooth and a 36-tooth gear. Use a list of lists for multiple
12-tooth gear connected to the motor and a 36-tooth gear
connected to the output. Use a list of lists for multiple
gear trains, such as ``[[12, 36], [20, 16, 40]]``.
When you specify a gear train, all motor commands and settings
are automatically adjusted to account for the resulting gear
ratio. The motor direction remains unchanged by this.
ratio. The motor direction remains unchanged by this.
reset_angle (bool):
Choose ``True`` to reset the rotation sensor value to the
absolute marker angle (between -180 and 179).
Expand Down Expand Up @@ -124,12 +127,10 @@ def __init__(self, name: Optional[str] = None, timeout: int = 10000):
"""

@overload
def name(self, name: str) -> None:
...
def name(self, name: str) -> None: ...

@overload
def name(self) -> str:
...
def name(self) -> str: ...

def name(self, *args):
"""name(name)
Expand Down

0 comments on commit 65748ca

Please sign in to comment.