use macro to set pwm duty cycle.