added code for arduino pwm output