pwm test code