User Tools

Site Tools

한국어

logicpython:cubloc_api:setontimer

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

logicpython:cubloc_api:setontimer [2026/04/10 02:06] – created - external edit 127.0.0.1logicpython:cubloc_api:setontimer [2026/04/10 06:12] (current) – removed mfranklin
Line 1: Line 1:
-====== SetOnTimer ====== 
- 
-Enable or disable execution of callbacks registered with ''OnTimer''. 
- 
-===== Syntax ===== 
- 
-<code python> 
-from cubloc import SetOnTimer 
- 
-SetOnTimer(enabled: bool) 
-</code> 
- 
-===== Parameters ===== 
- 
-  * **enabled**: ''True'' for On, ''False'' for Off. 
- 
-===== Exceptions ===== 
- 
-  * [[https://docs.micropython.org/en/latest/library/builtins.html#TypeError|TypeError]]: ''enabled'' is not a bool. 
- 
-===== Example ===== 
- 
-<code python> 
-from cubloc import OnTimer, SetOnTimer, Debug, CR 
- 
-def timer_handler(): 
-    Debug("Timer tick", CR) 
- 
-OnTimer(100, timer_handler) 
-SetOnTimer(False)   # Pause timer callback execution 
-SetOnTimer(True)    # Resume timer callback execution 
-</code> 
- 
-===== Related APIs ===== 
- 
-  * [[logicpython:cubloc_api:delay|Delay]] 
-  * [[logicpython:cubloc_api:ontimer|OnTimer]] 
-  * [[logicpython:cubloc_api:pause|Pause]] 
-  * [[logicpython:cubloc_api:udelay|UDelay]] 
-  * [[logicpython:cubloc_api:wait|Wait]] 
  
logicpython/cubloc_api/setontimer.1775786799.txt.gz · Last modified: by 127.0.0.1