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
7 changes: 4 additions & 3 deletions docs/microbit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Functions
:param n: An integer or floating point number indicating the number of
milliseconds to wait.

.. py:function:: run_every(callback, h=None, min=None, s=None, ms=None)
.. py:function:: run_every(callback, days=None, h=None, min=None, s=None, ms=None)

Schedule to run a function at the interval specified by the time arguments.

Expand All @@ -78,7 +78,7 @@ Functions
* As a **Decorator** - placed on top of the function to schedule.
For example::

@run_every(h=1, min=20, s=30, ms=50)
@run_every(days=1, h=1, min=20, s=30, ms=50)
def my_function():
# Do something here

Expand All @@ -89,14 +89,15 @@ Functions
# Do something here
run_every(my_function, s=30)

Each arguments corresponds to a different time unit and they are additive.
Each argument corresponds to a different time unit and they are additive.
So ``run_every(min=1, s=30)`` schedules the callback every minute and
a half.

When an exception is thrown inside the callback function it deschedules
the function. To avoid this you can catch exceptions with ``try/except``.

:param callback: Function to call at the provided interval.
:param days: Sets the days mark for the scheduling.
:param h: Sets the hour mark for the scheduling.
:param min: Sets the minute mark for the scheduling.
:param s: Sets the second mark for the scheduling.
Expand Down