Q-Code User Manual
Ver. 7.0 2021/11/30
232
Set the output percentage ratio (0%~100%)
Ex.
PWMOut(@1111, 30%)
Set the output level parameter (0~255)
Ex.
PWMOut(@1111, 127)
Ri (support 2 Ri)
Ex.
PWMOut(@1111, Ri:Rj)
Xi (support 1 Xi)
Ex.
PWMOut(@1111, Xi)
Time
: User can set the PWM-IO output time, the default time is 16ms. (Time=16ms~30sec)
Ex.
[Path]
TR1: PWMOut(@1111, 30%)
; PE0~PE3 output 30% luminance.
TR2: PWMOut(@1111, 30)
; PE0~PE3 output 30/256 luminance.
TR3: R1=0x1, R0=0xE, PWMOut(@1111, R1:R0)
; PE0~PE3 output 30/256 luminance.
TR4: X0=0x1E, PWMOut(@1111,X0)
; PE0~PE3 output 30/256 luminance.
TR5: PWMOut(@1111, 30%, 16ms)
; PE0~PE3 output 30% luminance and play for 16 ms.
TR6: PWMOut(@1111, 30, 2s)
; PE0~PE3 output 30/256 luminance and play for 2
seconds.
Note:
1. NY4 / NY5 / NY5+ / NY6 / NY7 / NX1 do not support this command.
2. When user set two PWM-IO output commands, the commands have to space out 16ms
above to avoid working error.
3. If the parameter of percentage is decided by register, it will occupy the space that DATA
ROM stores PWM-IO signals. (DATA Size calculation = (pin 1)*256).
4.20.2 PlayPWM / PlayPWMS(PWMEn, $VIOLabel, Extension)
User can draw the output Action signals by
Q-Visio
, and play signals by using PWM-IO command in
Q-Code
.
PlayPWM/PWMS(@PWMEn, $VIOLabel, Extension) { & [ BG1 {,BG2} ] }
PlayPWM
: After the end of playing Action file, executing the next command.
PlayPWMS
: When Action file starts playing, executing the next command immediately.
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
[I/O]
. There are 8 pins corresponding to
PE.0~PF.3 at most. PWMEn=1 or 0, 1=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.
PlayPWM(@1111, $VIO0, 4)
Ri (support 1 ~ 2 Ri)
Ex.
PlayPWM(R1:R0, $VIO0, 4)
Xi (support 1 Xi)
Ex.
PlayPWM(X0, $VIO0, 4)
Keep the last setting when filling in X
Ex.
PlayPWM(X, $VIO0, 4)