Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • You could try using a higher baudrate, instead of just 9600. Commented Mar 9, 2018 at 14:48
  • Possible explanation for the lag. Since serial data is being buffered; if you send data faster, than the serial connection can handle, you'd get lag. As the latest data has to wait in line to be send. Using a tiny delay, or better Serial.flush(), or Majenko's #3 suggestion would eliminate the lag caused by buffering. Commented Mar 9, 2018 at 15:00
  • NewPing right(9,6,100); NewPing left(7,5,100); Is the 100 the timeout for no return? Can you make that shorter? Commented Mar 9, 2018 at 15:30
  • its maximum distance ,100cm Commented Mar 9, 2018 at 15:58
  • Don't edit the question and invalidate an existing answer. Commented Mar 9, 2018 at 16:05