Current PWM code