Hardware Reference
In-Depth Information
Accessing the sonar sensor from the
Arduino IDE
Now that the HW is connected, you'll want to download a library that supports this sensor.
One of the better libraries for this sensor is available at https://code.google.com/p/arduino-
new-ping/ . Download the NewPing library and then open the Arduino IDE. You can in-
clude the library in the IDE by navigating to Sketch | Import Library | Add Library |
Downloads and selecting the NewPing ZIP file. Once you have the library installed, you
can access the example program by navigating to File | Examples | NewPing |
NewPingExample as shown in the following screenshot:
You will then see the following code in the IDE:
Search WWH ::




Custom Search