BL4S200 User’s Manual
88
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.
This function call is for the configurable I/O channels only.
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.
NOTE:
Configurable I/O channels DIO30 and DIO31 do not support PWM/PPM
functionality, and cannot be used with this function call.
PARAMETERS
channel
all channels on the same RIO chip and block as this channel (0–29,
DIO0–DIO29) 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)
RETURN VALUE
0 — success.
-EINVAL
— invalid parameter value.
SEE ALSO
brdInit, setPWM, setPPM, setOffset, setDuty, setToggle, setSync
electronic components distributor