NewPing Library: HC-SR04, SRF05, SRF06, DYP-ME007, Parallax PING))) - v1.7

hbaxton:
hi teckel & cyclegadget,

thank you for your response. i am new to events. so i tried taking out all the delays and also tried calling the ping function directly but i had the same results. i'm going to look into the adafruit motor library to see if it is using the timer as the new ping library.

thanks again! i'll report back.

You can't just remove the delays and expect it to work as then you'll have other problems. Instead, try using the replacement sketch I provided in a previous post that includes delays, but does so correctly. Your sketch was a hybrid, but used bad logic. To simplify things for you, my sketch does it the standard way, with the ping() method and delays. This is how you should use NewPing unless you know what you're doing and know how to write event-driven sketches. I do highly suggest that you learn this programming paradigm as you'll have a hard time graduating beyond "hello world" tests otherwise. But, maybe try something simple at first.

Tim