User Tools

Site Tools

한국어

logicpython:cubloc_api:steppulse

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.
  • qty: Number of pulses to output.

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
 
StepPulse(15, 2000, 5000)
 
while True:
    pass
logicpython/cubloc_api/steppulse.txt · Last modified: by mfranklin