BL4S200 User’s Manual
89
setDuty
int setDuty(int channel, float duty);
FUNCTION DESCRIPTION
Sets the duty cycle of the PWM or PPM output on a configurable I/O channel. Will
affect any PWM/PPM that has been bound to this channel’s PWM/PPM.
NOTE:
Configurable I/O channels DIO30 and DIO31 do not support PWM/PPM
functionality, and cannot be used with this function call.
PARAMETERS
channel
channel that is getting its duty cycle set, 0–29 (DIO0–DIO29)
duty
duty cycle of the PWM/PPM output (should be from 0 to 100%, a
duty cycle above 100.0% will be set to 100.0%)
RETURN VALUE
0 — success.
-EINVAL
— invalid parameter value.
-EPERM
— channel function does not permit this operation.
SEE ALSO
brdInit, setPWM, setPPM, setOffset, setFreq, setToggle, setSync
electronic components distributor