User Tools

Site Tools

한국어

logicpython:cubloc_api:setcount

Differences

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

Link to this comparison view

logicpython:cubloc_api:setcount [2026/04/10 02:06] – created - external edit 127.0.0.1logicpython:cubloc_api:setcount [2026/04/10 02:59] (current) – removed mfranklin
Line 1: Line 1:
-====== SetCount ====== 
- 
-Configure a high-speed counter ''channel'' for pulse counting using PWM ''edge''-count mode. 
- 
-===== Syntax ===== 
- 
-<code python> 
-from cubloc import SetCount 
- 
-SetCount(channel: int, edge: str | int = "rising") 
-</code> 
- 
-===== Parameters ===== 
- 
-  * **channel**: Counter ''channel'' number (0 to 4). 
-  * **edge**: ''Edge'' mode. Use "rising" (default), "falling", or int codes 0 and 1 respectively. 
- 
-===== Exceptions ===== 
- 
-  * [[https://docs.micropython.org/en/latest/library/builtins.html#TypeError|TypeError]]: ''channel'' type is invalid, or ''edge'' is not str/int. 
-  * [[https://docs.micropython.org/en/latest/library/builtins.html#ValueError|ValueError]]: ''channel'' or ''edge'' value is out of range. 
- 
-===== Example ===== 
- 
-<code python> 
-from cubloc import SetCount 
- 
-# Example usage 
-SetCount(0, "rising") 
-</code> 
- 
-===== Related APIs ===== 
- 
-  * [[logicpython:cubloc_api:count|Count]] 
-  * [[logicpython:cubloc_api:countreset|CountReset]] 
-  * [[logicpython:cubloc_api:freqout|FreqOut]] 
-  * [[logicpython:cubloc_api:pwm|Pwm]] 
-  * [[logicpython:cubloc_api:pwmoff|PwmOff]] 
  
logicpython/cubloc_api/setcount.1775786799.txt.gz · Last modified: by 127.0.0.1