mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 09:37:25 +00:00
api/builtins: add DCMotor
This is a strict subset of Motor, covering functionality of DC motors only. This is useful for motors without encoders, such as train motors. It is inherited by Motor, which adds functionality that requires encoders.
This commit is contained in:
+8
-5
@@ -17,7 +17,7 @@ The Motor Class
|
||||
|
||||
.. automethod:: pybricks.builtins.Motor.stalled
|
||||
|
||||
.. rubric:: Moving the motor
|
||||
.. rubric:: Motion
|
||||
|
||||
.. automethod:: pybricks.builtins.Motor.stop
|
||||
|
||||
@@ -29,14 +29,17 @@ The Motor Class
|
||||
|
||||
.. automethod:: pybricks.builtins.Motor.run_target
|
||||
|
||||
.. automethod:: pybricks.builtins.Motor.run_until_stalled
|
||||
|
||||
.. rubric:: Manual motion control
|
||||
|
||||
The following methods are useful if you want full manual control of
|
||||
the motor.
|
||||
|
||||
.. automethod:: pybricks.builtins.Motor.dc
|
||||
|
||||
.. rubric:: Moving the motor (advanced)
|
||||
|
||||
.. automethod:: pybricks.builtins.Motor.track_target
|
||||
|
||||
.. automethod:: pybricks.builtins.Motor.run_until_stalled
|
||||
|
||||
.. rubric:: Changing motor settings
|
||||
|
||||
.. automethod:: pybricks.builtins.Motor.set_run_settings
|
||||
|
||||
+14
-2
@@ -4,6 +4,16 @@
|
||||
.. automodule:: pybricks.pupdevices
|
||||
:no-members:
|
||||
|
||||
DCMotor
|
||||
^^^^^^^^^^^^
|
||||
|
||||
.. autoclass:: pybricks.builtins.DCMotor
|
||||
:noindex:
|
||||
:no-members:
|
||||
|
||||
.. automethod:: pybricks.builtins.DCMotor.dc
|
||||
:noindex:
|
||||
|
||||
Motor
|
||||
^^^^^^^^^^^^
|
||||
|
||||
@@ -11,8 +21,6 @@ Motor
|
||||
:noindex:
|
||||
:no-members:
|
||||
|
||||
.. rubric:: Methods for motors with rotation sensors
|
||||
|
||||
.. automethod:: pybricks._instances.Motor.angle
|
||||
:noindex:
|
||||
|
||||
@@ -37,6 +45,10 @@ Motor
|
||||
.. automethod:: pybricks._instances.Motor.run_target
|
||||
:noindex:
|
||||
|
||||
.. automethod:: pybricks.builtins.Motor.dc
|
||||
:noindex:
|
||||
|
||||
This method lets you use a motor as if it is a simple DC motor.
|
||||
|
||||
Color and Distance Sensor
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Reference in New Issue
Block a user