Test code for pwm