Re: Problem with this sketch

if you are using a NO, pin2 is not a PWM pin

It's not a PWM pin on the YES, either. Or the UNO. 8)