doc/pupdevices/Motor: fix reset_angle

The note about absolute angle support had accidentally ended up in the GyroSensor. It applies only to pupdevices.Motor.
This commit is contained in:
Laurens Valk
2020-03-24 16:25:06 +01:00
parent 0bee7ef984
commit ada50328bb
4 changed files with 26 additions and 6 deletions
+9
View File
@@ -9,6 +9,15 @@ Motor Tips & Tricks
.. *TODO*
.. _absangles:
Absolute angles
----------------------------
.. todo::
This section will be included in a future release.
.. _stalled:
Using stall detection
+1 -1
View File
@@ -192,7 +192,7 @@ class Motor(DCMotor):
pass
def reset_angle(self, angle):
"""Resets the accumulated rotation angle of the motor.
"""Sets the accumulated rotation angle of the motor to a desired value.
Arguments:
angle (:ref:`angle`): Value to which the angle should be reset.
-3
View File
@@ -186,9 +186,6 @@ class GyroSensor:
def reset_angle(self, angle):
"""Sets the rotation angle of the sensor to a desired value.
If you don't specify an angle, the absolute value will be used if
available.
Arguments:
angle (:ref:`angle`): Value to which the angle should be reset.
"""
+16 -2
View File
@@ -3,8 +3,22 @@
"""LEGO® Powered Up motor, sensors, and lights."""
from .builtins import KeyPad, Accelerometer, ColorLight
from .builtins import Motor # noqa E402
from .builtins import KeyPad, Accelerometer, ColorLight, Motor
class Motor(Motor):
"""Generic class to control motors with built-in rotation sensors."""
def reset_angle(self, angle=None):
"""Sets the accumulated rotation angle of the motor to a desired value.
If you don't specify an angle, the :ref:`absolute angle <absangles>`
will be used if your motor supports it.
Arguments:
angle (:ref:`angle`): Value to which the angle should be reset.
"""
pass
class RemoteControl: