User Tools

Site Tools

한국어

logicpython:cubloc_api:stepaccel

StepAccel

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

Syntax

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

Parameters

  • pin: Output GPIO pin number.
  • freqBase: Starting pulse frequency in pulses per second.
  • freqTop: Final pulse frequency after acceleration.
  • freqAccel: Acceleration rate in pulses per second per second. Must be > 0 when freqBase < freqTop.
  • qty: Number of pulses to output.

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