pwm sampling works now