Timer Alarm settings
-
I don't understand the syntax for creating an alarm object: class Timer.Alarm(handler=None, s, *, ms, us, arg=None, periodic=False)
usage example is given as:
Timer.Alarm(self._seconds_handler, 1, periodic=True)This example works but that only gives a single integer numeric parameter (which seems to achieve 1 second), please can we have an example of something else, say 150mS periodic alarm?
-
@soren
https://stackoverflow.com/questions/14301967/python-bare-asterisk-in-function-argumentto set something as named parameter specify its name and value
ms=15
-
@abilio regarding the documentation for Alarm, is it supposed to be obvious to everyone what the "*" argument means? I had no clue, and had to search the forum and end up here before I realised how to set the time in milliseconds.
-
Thanks - so much clearer now.
-
@robotmad, sure, it would be:
Timer.Alarm(self._seconds_handler, ms=150, periodic=True)