New Ping not working.

I had just downloaded the library "New Ping" for a distance sensor. The new library shows up, but does not work when I tried to test it. Error message says this:

Arduino: 1.5.8 (Windows 8), Board: "Arduino Uno"

sketch_dec27b.ino:2:21: fatal error: NewPing.h: No such file or directory compilation terminated. Error compiling.

I have tried adding the library into the file destination, but says it is unable to. Any suggestions?

You must save the library folder under your "libraries" folder, inside the sketches main folder on your system.

Where you have the folder of this library?

It shows up in the sketches folder, but still does not work.

Is not in the sketches folder. Inside the sketches folder you have one folder called “libraries”. You must copy the folder of your library to there. You can use too the option “Import Library…” from the “Sketch” menu of your Arduino IDE.

What is the exact name of the folder in which the NewPing.h is installed ?

It shows up in the sketches folder, but still does not work.

Bullpoop. If you can't even compile code that uses the library, you can NOT make any assertions as to the proper functioning of the code in the library.

UKHeliBob: What is the exact name of the folder in which the NewPing.h is installed ?

The file location is Arduino>libraries>NewPing_v1.5

Change the folder name to NewPing_v1_5;
Copy the files to this folder (if they are not in there yet);
Change the names of the files to NewPing_v1_5.h and NewPing_v1_5.cpp;

Change the line of your code:

#include <NewPing.h>

to

#include <NewPing_v1_5.h>

Save the file;

Restart your Arduino IDE and try to compile.

If you have troubles with this, go to this link http://arduino.cc/en/Guide/Libraries.

Rooster14250: The file location is Arduino>libraries>NewPing_v1.5

That is not the [u]exact[/u] location of the files but it does sound like it is the wrong place. Follow the advice in the link given in reply #7 to put it in the correct libraries folder (there are two) and to name the folder and files correctly.

Thanks for the advice guys! I just figured out that I had imported the uncompressed version of the library, and not the zip file. After uploading the right file, it worked except for a small coding error that I can fix. Thanks again!