NewPing library's example code won't open

I installed the NewPing library (1.9.4) and want to use its example code but it's not opening.

Upon looking at the library folder, I found the probable cause, I think its because each example code is in .pde file instead of .ino file

But why is it in .pde file?
and can you still open the example code using Files>Examples in the IDE?

share a link, it's probably something obsolete

(pde is the very old file extension prior to version 1.0 of the Arduino IDE)

I simply installed the library using the Include Library>Manage Libraries

Here's a screenshot of the library folder

I checked and indeed it's poor from their side... just rename those .pde into .ino and you'll be fine

yeah, I already know that turning it to .ino file will make it work
but I hope they can also update their files for better use.
Thank you.

you could raise a PR with them...
https://bitbucket.org/teckel12/arduino-new-ping/pull-requests/

you sure of that? Changing a .pde into an .ino makes no difference to me.

Yup, I'm pretty sure. It works for me.

Screenshot 2022-09-27 214656

Are you using Arduino IDE 2.x? There is a bug in that IDE series that causes this problem when attempting to open library examples with .pde extension (standalone sketches with this extension are handled somewhat better):

Yes I am. I also think at first that this is an IDE problem, since I've been witnessing so many bugs in the latest version.

Please report them here on the forum. Or if you prefer to submit formal bug reports directly to the developers, you can do that on GitHub, following the instructions here:

https://github.com/arduino/arduino-ide/blob/main/docs/contributor-guide/issues.md#issue-report-guide

I'm happy to investigate problems reported here on the forum. I can sometimes provide solutions or workarounds for them. If not, at least I can work with the IDE developers to try to get them fixed.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.