Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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