Refine PWM demo