add new function to control pwm pin and value.