BL4S100 User’s Manual
69
setFreq
int setFreq(int channel, float frequency);
FUNCTION DESCRIPTION
Sets the frequency of all the PWM or PPM outputs on the same block as the channel.
Will preserve the duty cycle and offset percentages for all of the channels on the same
block.
Repeated calls to this function by itself may cause the duty cycle and offset values to
drift. If this drift is of concern, call
setOffset()
and
setDuty()
to reset the duty
cycle and offset to the desired value.
PARAMETERS
channel
all digital output channels on the same RIO chip and block as this
channel (0–7, OUT0–OUT7) will have their frequency set. Duty
cycle and offset percentages will be maintained.
frequency
frequency of the PWM and PPM outputs (should be from 2 Hz to
50 kHz). Use -1 to preserve the existing frequency on the RIO
block.
RETURN VALUE
0 — success.
-EINVAL
— invalid parameter value.
SEE ALSO
brdInit, setPWM, setPPM, setOffset, setDuty, setSyncIn, setSyncOut,
pulseEnable, pulseDisable