This shows you the differences between two versions of the page.
| logicpython:cubloc_api:ontimer [2026/04/10 02:06] – created - external edit 127.0.0.1 | logicpython:cubloc_api:ontimer [2026/04/10 06:11] (current) – removed mfranklin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== OnTimer ====== | ||
| - | |||
| - | Register a periodic timer '' | ||
| - | |||
| - | ===== Syntax ===== | ||
| - | |||
| - | <code python> | ||
| - | from cubloc import OnTimer | ||
| - | |||
| - | OnTimer(interval: | ||
| - | </ | ||
| - | |||
| - | ===== Parameters ===== | ||
| - | |||
| - | * **interval**: | ||
| - | * **callback**: | ||
| - | |||
| - | ===== Exceptions ===== | ||
| - | |||
| - | * [[https:// | ||
| - | * [[https:// | ||
| - | * [[https:// | ||
| - | |||
| - | ===== Example ===== | ||
| - | |||
| - | <code python> | ||
| - | from cubloc import OnTimer, Debug, CR | ||
| - | |||
| - | def timer_handler(): | ||
| - | Debug(" | ||
| - | |||
| - | # 100 ticks x 10 ms = 1000 ms (1 second) | ||
| - | OnTimer(100, | ||
| - | </ | ||
| - | |||
| - | ===== Related APIs ===== | ||
| - | |||
| - | * [[logicpython: | ||
| - | * [[logicpython: | ||
| - | * [[logicpython: | ||
| - | * [[logicpython: | ||
| - | * [[logicpython: | ||