Specifications

Curtis 1310 Manual, Rev. B
33
1 6 F E B R U A R Y 2 0 0 8 D R A F T
5 — VCL
Automate_PWM(2)
This function is used to automatically update the PWM output. This function only
needs to be called once. After this function is called, the PWM output will run con
-
tinuously. Note that in this function, the output value must be a variable.
Parameters
PWM# Identifies which PWM channel is to be read (PWM1–PWM16).
Variable The variable that holds the desired output voltage;
the scale is 0–32767 = 0–100% On.
Returns
0 – Setup did not execute.
1 – Setup successful.
Error Codes Bad_ID Incorrect PWM ID was used.
PT_Range The variable used is not acceptable.
Example User1=0
Automate_PWM(PWM1,User1)
Loop:
User1=User1+1
;this will create a 0–100% PWM ramp on Output 1
If User1=32767
{
User1=0
}
;add some delay or code here
Goto Loop