diff --git a/doc/api/iodevices_ev3.inc b/doc/api/iodevices_ev3.inc index 86e64eb..552bb30 100644 --- a/doc/api/iodevices_ev3.inc +++ b/doc/api/iodevices_ev3.inc @@ -74,6 +74,9 @@ This class can be used to control classic LEGO motors using converter cables. .. automethod:: pybricks.builtins.DCMotor.dc :noindex: + .. automethod:: pybricks.builtins.DCMotor.stop + :noindex: + Ev3dev sensors ^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/api/pupdevices.rst b/doc/api/pupdevices.rst index 2f08ad5..111a63a 100644 --- a/doc/api/pupdevices.rst +++ b/doc/api/pupdevices.rst @@ -14,6 +14,9 @@ Motors without Rotation Sensors .. automethod:: pybricks.builtins.DCMotor.dc :noindex: + .. automethod:: pybricks.builtins.DCMotor.stop + :noindex: + Motors with Rotation Sensors ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/pybricks/builtins.py b/pybricks/builtins.py index 00bb9f1..65e911c 100644 --- a/pybricks/builtins.py +++ b/pybricks/builtins.py @@ -30,6 +30,15 @@ class DCMotor: """ pass + def stop(self, stop_type=Stop.COAST): + """Stop the motor. + + Arguments: + stop_type (Stop): Whether to coast, brake, or hold (*Default*: + :class:`Stop.COAST <.parameters.Stop>`). + """ + pass + class Control: """Class to interact with PID controller and settings.