From 2588b997c43e56661c1eae7262513fe37d3def7c Mon Sep 17 00:00:00 2001 From: Carlos Pereira Atencio Date: Mon, 16 Sep 2024 23:38:00 +0100 Subject: [PATCH] docs: Add display.rotate(). --- docs/display.rst | 6 ++++++ docs/microbit_micropython_api.rst | 2 ++ 2 files changed, 8 insertions(+) diff --git a/docs/display.rst b/docs/display.rst index 76a45a390..01117c023 100644 --- a/docs/display.rst +++ b/docs/display.rst @@ -72,6 +72,12 @@ Functions Note that the ``wait``, ``loop`` and ``monospace`` arguments must be specified using their keyword. +.. py:function:: rotate(degrees) + + Rotate the images shown on the display. The ``degrees`` parameter can be + any number, including a negative rotation, and it will be rounded to the + nearest multiple of 90 degrees. + .. py:function:: on() Use on() to turn on the display. diff --git a/docs/microbit_micropython_api.rst b/docs/microbit_micropython_api.rst index 19362fdac..2eeeac89e 100644 --- a/docs/microbit_micropython_api.rst +++ b/docs/microbit_micropython_api.rst @@ -76,6 +76,8 @@ The LED display is exposed via the `display` object:: # scrolls a string across the display (more exciting than display.show for # written messages). display.scroll(string, delay=400) + # Rotates the display 0, 90, 180 or 270 degrees. + display.rotate(degrees) SoundEvent **V2** -----------------