Skip to content

Commit

Permalink
docs: Alphabetise microbit module & use docstring notations. (#734)
Browse files Browse the repository at this point in the history
* docs: Reorganise microbit module entries to be listed alphabetically.

* docs: Update microbit module docs to use docstring notations.
  • Loading branch information
microbit-carlos committed Apr 19, 2022
1 parent 9dc2a60 commit 815b08c
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions docs/microbit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,38 @@ Functions

.. py:function:: panic(n)
Enter a panic mode. Requires restart. Pass in an arbitrary integer <= 255
to indicate a status::
Enter a panic mode that stops all execution, scrolls an error code in
the micro:bit display and requires restart::

microbit.panic(255)

:param n: An arbitrary integer between 0 and 255 to indicate an error code.


.. py:function:: reset()
Restart the board.


.. py:function:: sleep(n)
Wait for ``n`` milliseconds. One second is 1000 milliseconds, so::
.. py:function:: running_time()
microbit.sleep(1000)
:returns: The number of milliseconds since the board was switched on or
restarted.

will pause the execution for one second. ``n`` can be an integer or
a floating point number.

.. py:function:: sleep(n)
.. py:function:: running_time()
Wait for ``n`` milliseconds. One second is 1000 milliseconds, so
``microbit.sleep(1000)`` will pause the execution for one second.

Return the number of milliseconds since the board was switched on or
restarted.
:param n: An integer or floating point number indicating the number of
milliseconds to wait.


.. py:function:: temperature()
Return the temperature of the micro:bit in degrees Celcius.
:returns: An integer with the temperature of the micro:bit in degrees
Celcius.


Attributes
Expand Down Expand Up @@ -70,9 +72,9 @@ Modules
.. toctree::
:maxdepth: 1

display.rst
uart.rst
spi.rst
i2c.rst
accelerometer.rst
compass.rst
display.rst
i2c.rst
spi.rst
uart.rst

0 comments on commit 815b08c

Please sign in to comment.