Attaching a servo affects pulseIn readings

Indeed the wrong category :wink: Installation and Troubleshooting is not for problems with (nor for advise on) your project :wink: See About the Installation & Troubleshooting category.

I've moved it.

Can you please post your problematic code; use the </> button when doing so. Alternatively

  1. In the IDE, use tools -> autoformat to properly indent the code.
  2. In the IDE, use edit -> copy for forum to place a copy of the sketch on the clipboard.
  3. Paste the clipboard content in a reply here.