diff --git a/doc/main/ev3devices.rst b/doc/main/ev3devices.rst index 9fbc695..ec6c9fd 100644 --- a/doc/main/ev3devices.rst +++ b/doc/main/ev3devices.rst @@ -44,17 +44,42 @@ Motors .. automethod:: pybricks.ev3devices.Motor.run_target + .. automethod:: pybricks.ev3devices.Motor.track_target + .. automethod:: pybricks.ev3devices.Motor.run_until_stalled .. automethod:: pybricks.ev3devices.Motor.dc - .. rubric:: Advanced motion control + .. rubric:: Motor status - .. automethod:: pybricks.ev3devices.Motor.track_target + .. attribute:: control.scale - .. autoattribute:: pybricks.ev3devices.Motor.control - :annotation: + Number of degrees that the motor turns to complete one degree at the + output of the gear train. This is the gear ratio determined from the + ``gears`` argument when initializing the motor. + .. automethod:: pybricks.ev3devices.Motor.control.done + + .. automethod:: pybricks.ev3devices.Motor.control.stalled + + .. automethod:: pybricks.ev3devices.Motor.control.load + + .. rubric:: Motor 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.ev3devices.Motor.settings + + .. automethod:: pybricks.ev3devices.Motor.control.limits + + .. automethod:: pybricks.ev3devices.Motor.control.pid + + .. automethod:: pybricks.ev3devices.Motor.control.target_tolerances + + .. automethod:: pybricks.ev3devices.Motor.control.stall_tolerances Touch Sensor ^^^^^^^^^^^^ diff --git a/doc/main/hubs/ev3brick.rst b/doc/main/hubs/ev3brick.rst index ae3fba0..91805cc 100644 --- a/doc/main/hubs/ev3brick.rst +++ b/doc/main/hubs/ev3brick.rst @@ -38,14 +38,18 @@ MINDSTORMS EV3 Brick .. automethod:: pybricks.hubs::EV3Brick.screen.clear .. automethod:: pybricks.hubs::EV3Brick.screen.draw_text + :noindex: .. automethod:: pybricks.hubs::EV3Brick.screen.print + :noindex: .. automethod:: pybricks.hubs::EV3Brick.screen.set_font + :noindex: .. automethod:: pybricks.hubs::EV3Brick.screen.load_image .. automethod:: pybricks.hubs::EV3Brick.screen.draw_image + :noindex: .. automethod:: pybricks.hubs::EV3Brick.screen.draw_pixel diff --git a/src/pybricks/ev3dev/_speaker.py b/src/pybricks/ev3dev/_speaker.py index ca7ff92..6e016b0 100644 --- a/src/pybricks/ev3dev/_speaker.py +++ b/src/pybricks/ev3dev/_speaker.py @@ -66,7 +66,7 @@ class Speaker: """Says a given text string. You can configure the language and voice of the text using - :meth:`set_speech_options`. + :meth:`.set_speech_options`. Arguments: text (str): What to say. @@ -75,10 +75,10 @@ class Speaker: pass def set_speech_options(self, language=None, voice=None, speed=None, pitch=None): - """Configures speech settings used by the :meth:`say` method. + """Configures speech settings used by the :meth:`.say` method. Any option that is set to ``None`` will not be changed. If an option - is set to an invalid value :meth:`say` will use the default value + is set to an invalid value :meth:`.say` will use the default value instead. Arguments: @@ -105,8 +105,8 @@ class Speaker: Volume of the speaker. which (str): Which volume to set. ``'Beep'`` sets the volume for - :meth:`beep` and :meth:`play_notes`. ``'PCM'`` sets the volume - for :meth:`play_file` and :meth:`say`. ``'_all_'`` sets both - at the same time. + `beep` and `play_notes`. ``'PCM'`` sets the + volume for :meth:`.play_file` and :meth:`.say`. ``'_all_'`` + sets both at the same time. """ pass diff --git a/src/pybricks/media/ev3dev.py b/src/pybricks/media/ev3dev.py index 1edc14d..59676c2 100644 --- a/src/pybricks/media/ev3dev.py +++ b/src/pybricks/media/ev3dev.py @@ -117,8 +117,9 @@ class Image: y (int): The y-axis value where the top of the image will start. source (Image or str): - The source :class:`Image`. If the argument is a string, then - the ``source`` image is loaded from file. + The source :class:`Image `. If + the argument is a string, then the ``source`` image is loaded + from file. transparent (Color): The color of ``image`` to treat as transparent or ``None`` for no transparency. @@ -130,15 +131,17 @@ class Image: Arguments: source (Image or str): - The source :class:`Image`. If the argument is a string, then - the ``source`` image is loaded from file. + The source :class:`Image `. If + the argument is a string, then the ``source`` image is loaded + from file. """ def draw_text(self, x, y, text, text_color=_Color.BLACK, background_color=None): """Draws text on |this image|. - The most recent font set using :meth:`set_font` will be used or - :data:`Font.DEFAULT` if no font has been set yet. + The most recent font set using :meth:`.set_font` will be used or + :data:`Font.DEFAULT ` if no font + has been set yet. Arguments: x (int): @@ -150,8 +153,8 @@ class Image: text_color (Color): The color used for drawing the text. background_color (Color): - The color used to fill the rectangle behind the text or ``None`` - for transparent background. + The color used to fill the rectangle behind the text or + ``None`` for transparent background. """ pass @@ -161,14 +164,16 @@ class Image: This method works like the builtin ``print()`` function, but it writes on |this image| instead. - You can set the font using :meth:`set_font`. If no font has been set, - :data:`Font.DEFAULT` will be used. The text is always printed used - black text with a white background. + You can set the font using :meth:`.set_font`. If no font has been set, + :data:`Font.DEFAULT ` will be + used. The text is always printed used black text with a white + background. Unlike the builtin ``print()``, the text does not wrap if it is too - wide to fit on |this image|. It just gets cut off. But if the text would - go off of the bottom of |this image|, the entire image is scrolled up and - the text is printed in the new blank area at the bottom of |this image|. + wide to fit on |this image|. It just gets cut off. But if the text + would go off of the bottom of |this image|, the entire image is + scrolled up and the text is printed in the new blank area at the + bottom of |this image|. Arguments: * (object): @@ -184,10 +189,10 @@ class Image: def set_font(self, font): """Sets the font used for writing on |this image|. - The font is used for both :meth:`draw_text` and :meth:`print`. + The font is used for both :meth:`.draw_text` and :meth:`.print`. Arguments: - font (:class:`Font`): + font (Font): The font to use. """ pass