Skip to content

Commit 815b08c

Browse files
docs: Alphabetise microbit module & use docstring notations. (bbcmicrobit#734)
* docs: Reorganise microbit module entries to be listed alphabetically. * docs: Update microbit module docs to use docstring notations.
1 parent 9dc2a60 commit 815b08c

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

docs/microbit.rst

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,38 @@ Functions
1313

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

1919
microbit.panic(255)
2020

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

2224
.. py:function:: reset()
2325
2426
Restart the board.
2527

2628

27-
.. py:function:: sleep(n)
28-
29-
Wait for ``n`` milliseconds. One second is 1000 milliseconds, so::
29+
.. py:function:: running_time()
3030
31-
microbit.sleep(1000)
31+
:returns: The number of milliseconds since the board was switched on or
32+
restarted.
3233

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

35+
.. py:function:: sleep(n)
3636
37-
.. py:function:: running_time()
37+
Wait for ``n`` milliseconds. One second is 1000 milliseconds, so
38+
``microbit.sleep(1000)`` will pause the execution for one second.
3839

39-
Return the number of milliseconds since the board was switched on or
40-
restarted.
40+
:param n: An integer or floating point number indicating the number of
41+
milliseconds to wait.
4142

4243

4344
.. py:function:: temperature()
4445
45-
Return the temperature of the micro:bit in degrees Celcius.
46+
:returns: An integer with the temperature of the micro:bit in degrees
47+
Celcius.
4648

4749

4850
Attributes
@@ -70,9 +72,9 @@ Modules
7072
.. toctree::
7173
:maxdepth: 1
7274

73-
display.rst
74-
uart.rst
75-
spi.rst
76-
i2c.rst
7775
accelerometer.rst
7876
compass.rst
77+
display.rst
78+
i2c.rst
79+
spi.rst
80+
uart.rst

0 commit comments

Comments
 (0)