UNO + unstable PWM + Linear Led Drive

I'm using the reed switch as a sort of speedometer

Dose it have to be on th RX pin. This will stop you being able to upload code and will also prevent you getting any debug serial output.