Name:
hpwmduty
Syntax:

HPWMDUTY duty

Duty - is a variable/constant (0-1023) which sets the PWM duty cycle. (duty cycle is the mark or 'on time' )

Description:

Alter the duty cycle after a hpwm command has been issued.

The hpwmduty command can be used to alter the hpwm duty cycle without resetting the internal timer (as occurs with a hpwm command). A hpwm command must be issued before this command will function

See the hpwm command for more details.

Applies To:
14M2, 20M2, 20X2, 28X1, 28X2, 40X2
See Also:
Related Create:
Share:
Print:

Start and change a hardware PWM signal

Enable a hardware PWM signal and then change its duty rate

Code Example:
init:	hpwm 0,0,%1111,150,100	; start pwm

main:	hpwmduty 150		; set pwm duty
	pause 1000		; pause 1 s
	hpwmduty 50		; set pwm duty
	pause 1000		; pause 1 s
	goto main		; loop back to start
Copy Code Submit an Example

Submit Your Own Code!

You must be logged in to submit code examples. Login now.