I8088W_Setpwmduty_Deci - ICP DAS USA I-8088W Api Reference Manual

I/o module
Table of Contents

Advertisement

3.6. i8088W_SetPWMDuty_Deci

The function is used to set the PWM parameters precisely.
Syntax
short i8088W_SetPWMDuty_Deci
(int slot,int ch,unsigned long deci_Hz,unsigned int deci_duty);
Note:
i8088W_SetPWMDuty_Deci is the same as i8088W_SetPWMDuty_float in
usage, but the i8088W_SetPWMDuty_Deci will run faster than
i8088W_SetPWMDuty_floa for the floating calculation reason
Parameter
1. slot 0 ~ 7
2. ch 0 ~ 7
3. deci_Hz example: 10 deci_Hz = 10 Hz
4. deci_duty 0~999, for example: 503 deci_duty = 50.3% High Part
5. Low Part=1000 - 503= 497 => 49.7% Low Duty cycle
Return Values
Please refer to Error Code Table.
Examples
[C]
int slot,ch;
slot = 0;
for(ch=0;ch<8;ch++)
{
i8088W_ SetPWMDuty_Deci(slot,ch,50.3);
}
I-8088W API Reference Manual, Version 1.0.0, Aug. 2010
--- 30

Advertisement

Table of Contents
loading

Table of Contents