User Tools

Site Tools

한국어

logicpython:cubloc_api:stepaccel

This is an old revision of the document!


StepAccel

Output an accelerated pulse train on step channel 0 using a PIO state machine.

Syntax

from cubloc import StepAccel
 
StepAccel(channel: int, pin: int, freqBase: int, freqTop: int, freqAccel: int, qty: int)

Parameters

  • channel: StepPulse channel number. StepAccel supports only channel 0.
  • pin: Output GPIO pin number.
  • freqBase: Starting pulse frequency in pulses per second (20 to 3300).
  • freqTop: Final pulse frequency after acceleration (20 to 3300).
  • freqAccel: Acceleration rate in pulses per second per second. Must be > 0 when freqBase < freqTop.
  • qty: Number of pulses to output (0 to 2147483647).

Exceptions

  • TypeError: An argument has an invalid type.
  • ValueError: channel or a numeric argument is outside the supported range.

Notes

  • Note: Acceleration is implemented as a staircase of fixed-frequency PIO segments, so small gaps can occur when the next segment is reconfigured.

Example

from cubloc import StepAccel
 
# Example usage
StepAccel(0, 0, 1, 1, 1, 1)
logicpython/cubloc_api/stepaccel.1775786799.txt.gz · Last modified: by 127.0.0.1