User Tools

Site Tools

한국어

logicpython:cubloc_api:pwm

Pwm

Output a PWM waveform on the specified channel.

Syntax

from cubloc import Pwm
 
Pwm(channel: int, duty: int, period: int)

Parameters

  • channel: PWM channel number. This hardware supports channels 0 through 9.
  • duty: duty count, where 0 <= duty < period.
  • period: PWM period count (1 to 65535).

Exceptions

  • TypeError: An argument is not an integer.
  • ValueError: channel, duty, or period is out of range.

Example

from cubloc import Pwm
 
# Example usage
Pwm(0, 1, 1)
logicpython/cubloc_api/pwm.txt · Last modified: by mfranklin