An open API service indexing awesome lists of open source software.

https://github.com/kaxori/Action-Repeater

Repeats an action after defined timeout period.
https://github.com/kaxori/Action-Repeater

esp32 toit toit-language

Last synced: over 1 year ago
JSON representation

Repeats an action after defined timeout period.

Awesome Lists containing this project

README

          

# Action_Repeater
Repeats an action after defined timeout period.

## Install
```
jag pkg install action_repeater
```

## Usage
A simple usage example.
``` toit
import action_repeater show *

STEP_DELAY ::= 10_000
startTime := ?

dtStr-> string:
return "$(%6.1f (Duration.since startTime).in_ms/1000.0)s :"

main:
print "\n\n\nTest of ActionRepeater\n"
count := 0
startTime = Time.now

action := ActionRepeater --timeout_ms=1_000 --action=::
++count
print dtStr + "action code called #$count"

sleep --ms=1000

action.start 200
sleep --ms=1000

action.start 2000
sleep --ms=STEP_DELAY

action.stop
sleep --ms=STEP_DELAY

action.trigger
action.trigger

```
See the `examples` folder for more examples.

## Features and bugs

Please file feature requests and bugs at the [issue tracker][tracker].

[tracker]: https://github.com/kaxori/action-repeater/issues