diff --git a/docs/microbit.rst b/docs/microbit.rst index 749ffecc4..97bb697e4 100644 --- a/docs/microbit.rst +++ b/docs/microbit.rst @@ -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 @@ -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