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.
- Host: GitHub
- URL: https://github.com/kaxori/Action-Repeater
- Owner: kaxori
- License: mit
- Created: 2023-06-30T17:54:26.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-28T15:55:57.000Z (almost 3 years ago)
- Last Synced: 2024-10-23T20:12:17.661Z (over 1 year ago)
- Topics: esp32, toit, toit-language
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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