Q-Code User Manual
Ver. 7.0 2021/11/30
235
Note:
1. NX1 does not support this command.
2. NY4 / NY5 / NY6 / NY7 / NY9T do not support Px.n parameter.
4.20.7 HoldPWM
Pause the playing PWM-IO, and hold the current output type without entering the sleep mode.
Note: NY4 / NY5 / NY5+ / NY6 / NY7 / NX1 do not support this command.
4.20.8 PWMCtrl(@PWMEn, Extension)
User can control the set PWM-IO pins in the
[I/O Pin]
section. The usage of PWMEn is same to the
PlayPWM command, please refer to 4.20.2
Note: NY4 / NY5 / NY5+ / NY6 / NY7 / NX1 do not support this command.
Ex. User can turn on or off the output of PWM-IO during playing PWM-IO (PE.0~PE.3).
[Path]
PowerOn
:
PWMCtrl(@1111,1)
; Default PWMIO as1111, Extension=1.
TR1: PlayPWM(X, $VIO0)
; Play “VIO0” and output to PE.
TR2: PWMCtrl(@0011,X)
; Close the output of PE.2 and PE.3.
TR3: PWMCtrl(X, 4)
; Set the Extension in the multiple of 4.
4.20.9 PWMDuty
Change the PWM-IO on specified pin.
PWMDuty(Px.n, Duty)
Px.n:
specify PWM-IO pin to change.
Duty:
User can designate the output percentage and levels via an immediate value, or designate
levels via variables.
Output level via immediate value .
Output percentage via immediate value
Output level via Ri (Fixed using 2 Ri)
Output level via Xi ((Fixed using 1 Xi)
Note: NY4 / NY5 / NY6 / NY7 / NY9T / NX1 do not support this command.
Ex.
PWMDuty(PB.0, 50%)
PWMDuty(PB.0, 8)
PWMDuty(PB.0, R1:R0)
PWMDuty(PB.0, X0)