From 631cf31a07e5e2b446d4ba6a64aa1693a214b83c Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Fri, 2 Dec 2022 12:10:31 +0100 Subject: [PATCH] pybricks.common.Motor: Document when settings take effect. This updates how and when settings take effect. In this release, you can change them even while the motor is moving. Some settings do not take effect right away, as now indicated in the relevant methods. See also https://github.com/pybricks/pybricks-api/issues/105 --- doc/main/pupdevices/motor.rst | 4 ---- src/pybricks/_common.py | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/main/pupdevices/motor.rst b/doc/main/pupdevices/motor.rst index 674a679..436777f 100644 --- a/doc/main/pupdevices/motor.rst +++ b/doc/main/pupdevices/motor.rst @@ -64,10 +64,6 @@ Motors with rotation sensors .. rubric:: Control settings - You can only change these settings while the controller is stopped. For - example, you can change them at the start of your program. Alternatively, - first call :meth:`stop() `, and then change the settings. - .. automethod:: pybricks.pupdevices.Motor.control.limits .. automethod:: pybricks.pupdevices.Motor.control.pid diff --git a/src/pybricks/_common.py b/src/pybricks/_common.py index 278d93c..61d63c1 100644 --- a/src/pybricks/_common.py +++ b/src/pybricks/_common.py @@ -199,6 +199,9 @@ class Control: If no arguments are given, this will return the current values. + The new ``acceleration`` and ``speed`` limit will become effective + when you give a new motor command. Ongoing maneuvers are not affected. + Arguments: speed (Number, deg/s or Number, mm/s): Maximum speed. All speed commands will be capped to this value.