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?
-
@robotmad, sure, it would be:
Timer.Alarm(self._seconds_handler, ms=150, periodic=True) -
Thanks - so much clearer now.
-
@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.
-
@soren
https://stackoverflow.com/questions/14301967/python-bare-asterisk-in-function-argumentto set something as named parameter specify its name and value
ms=15
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login