Two sonars stops working when pin 17 set to output

Issue #68 resolved
Former user created an issue

Arduino mega 2560, when "pinMode(17, OUTPUT)" is uncommented in the attached code, sonar1 stops working (always returns 0 distance). Only seems to apply to pin 17.

Comments (2)

  1. Tim Eckel repo owner

    This wouldn't have anything to do with the NewPing library. My guess is that there's a conflict between the analog pings you're using and pin 17. Pin 17 is a serial pin, so it uses timers which could have a conflict with other pins. This is a common Arduino issue.

  2. Log in to comment