User Tools

Site Tools

한국어

logicpython:cubloc_api:steppulse

This is an old revision of the document!


StepPulse

Output a finite pulse train on the specified pin using a PIO state machine.

Syntax

from cubloc import StepPulse
 
StepPulse(pin: int, freq: int, qty: int)

Parameters

  • pin: Output GPIO pin number.
  • freq: Output frequency in pulses per second (1 to 15000).
  • qty: Number of pulses to output (0 to 2147483647).

Exceptions

  • TypeError: channel, pin, freq, or qty has an invalid type.
  • ValueError: channel, freq, or qty is outside the supported range.

Notes

  • Note: Pulse generation is handled by PIO, not PWM.

Example

from cubloc import StepPulse
 
# Example usage
StepPulse(15, 2000, 5000)
logicpython/cubloc_api/steppulse.1776835289.txt.gz · Last modified: by mfranklin