Q-Code User Manual
Ver. 7.0 2021/11/30
231
Output level via immediate value .
Ex.
PWMOut(PC.0, 12, 1s)
Output percentage via immediate value
Ex.
PWMOut(PC.0, 30%, 1s)
Output level via Ri (Fixed using 2 Ri)
Ex.
PWMOut(PC.0, R1:R0, 1s)
Output level via Xi ((Fixed using 1 Xi)
Ex.
PWMOut(PC.0, X0, 1s)
Time
: Set the PWM-IO output time, default 16ms if omitted. Loop is also accepted to output PWM
(Time=16ms~30sec)
Type:
use software PWM-IO (0) or hardware PWM-IO (1), default is software PWM-IO (0).
Note:
1. NY9T / NX1 do not support this command.
2. NY4 / NY5 / NY6 / NY7 do not support Type parameter.
4.20.1.2 PWMOut / PWMOutS (Para8, Para7, Para6, Para5, Para4, Para3, Para2, Para1)
The PWMOut command is for setting the Duty cycle of all PWM-IO pins, it can output directly
without the PlayPWM command.
Para1~8
: It presents the serial number of each pin, Para1=PE.0, Para2=PE.1, and so forth. (Only
the pins of PWM-IO can set the serial number.)
Set the percentage of output directly. (0%~100%)
Ex.
PWMOut(30%, 50%, 70%, 5%)
Set the levels of output. (0~255)
Ex.
PWMOut(30, 50, 70, 5)
Time
: User can set the output time of PWM-IO, the default is 16ms. (Time=16ms~30sec)
Note:
1. NY4 / NY5 / NY5+ / NY6 / NY7 / NX1 do not support this command.
2. In NY9T, when user set two PWM-IO output commands, the commands have to space out
16ms above to avoid working error.
4.20.1.3 PWMOut / PWMOutS (@PWMEn, Percentage, Time)
PWMEn:
The corresponding usage of pins and files is according to the sequence of PWM-IO output
pin and the Label “A1~A8” of Action files in the
[I/O Pin]
section. There are 8 pins
corresponding to PE.0~PF.3 at most. PWMEn=1 or 0, Activate PWM-IO output function
when the designated pin plays Action file;
0=Not turned. (The unfilled part will be filled in 0
automatically, the MSB is on the leftmost)
Set the designated output pin
Ex.
PWMOut(@1111, 30%)
Ri (support 2 Ri)
Ex.
PWMOut(R1:R0, 30%)
Xi (support 1 Xi)
Ex.
PWMOut(X0, 30%)
Keep the last setting when filling in X
Ex.
PWMOut(X, 30%)
Percentage:
Set the output parameter by percentage or level.