User Tools

Site Tools

한국어

logicpython:cubloc_api:setcount

This is an old revision of the document!


SetCount

Configure a high-speed counter channel for pulse counting using PWM edge-count mode.

Syntax

from cubloc import SetCount
 
SetCount(channel: int, edge: str | int = "rising")

Parameters

  • channel: Counter channel number (0 to 4).
  • edge: Edge mode. Use “rising” (default), “falling”, or int codes 0 and 1 respectively.

Exceptions

  • TypeError: channel type is invalid, or edge is not str/int.
  • ValueError: channel or edge value is out of range.

Example

from cubloc import SetCount
 
# Example usage
SetCount(0, "rising")
logicpython/cubloc_api/setcount.1775786799.txt.gz · Last modified: by 127.0.0.1