hizon
September 27, 2022, 1:15pm
1
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?
J-M-L
September 27, 2022, 1:18pm
2
share a link, it's probably something obsolete
(pde is the very old file extension prior to version 1.0 of the Arduino IDE)
hizon
September 27, 2022, 1:29pm
3
I simply installed the library using the Include Library>Manage Libraries
Here's a screenshot of the library folder
J-M-L
September 27, 2022, 1:32pm
4
I checked and indeed it's poor from their side... just rename those .pde into .ino and you'll be fine
hizon
September 27, 2022, 1:37pm
5
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.
J-M-L
September 27, 2022, 1:40pm
6
you sure of that? Changing a .pde into an .ino makes no difference to me.
hizon
September 27, 2022, 1:49pm
8
Yup, I'm pretty sure. It works for me.
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):
opened 09:58AM - 28 Sep 21 UTC
closed 07:26AM - 29 Sep 23 UTC
topic: code
type: imperfection
### Describe the problem
If the example for a library has `.pde` file extensi… on, Arduino IDE will silently fail to open it.
### To reproduce
1. Use Library Manager to install version "**1.1**" of the "**TimerOne**" library from Library Manager
1. Select **Examples > TimerOne > Interrupt**
🐛 The example doesn't open. There is no communication of a problem.
### Expected behavior
Arduino IDE opens all valid example sketches, regardless of whether they use a deprecated file extension.
### Arduino IDE version
2.0.0-beta.11
### Operating system
- macOS
- Windows
### Operating system version
- Windows 10
- macOS (not stated)
### Additional context
On the [Arduino forum](https://forum.arduino.cc/t/arduino-ide-2-0-beta-silently-fails-if-library-example-has-pde-extension/909565), user [in0](https://forum.arduino.cc/u/in0/summary) has reproduced the error on Windows and provides additional info:
> I can reproduce it. You can see the problem when run from the command line:
>
> ```
> root ERROR Request cloneExample failed with error: ENOENT: no such file or directory, rename 'c:\Users\<user name>\AppData\Local\Temp\.arduinoIDE-unsaved2021827-16716-11heo0w.vdua\Interrupt\Interrupt.pde' -> 'c:\Users\<user name>\AppData\Local\Temp\.arduinoIDE-unsaved2021827-16716-11heo0w.vdua\Interrupt\Interrupt.ino'
> ```
>
> It's trying to rename the sketch in the temporary folder rather than in its true path under the library installation.
>
> I don't have this problem with a standalone sketch using the .pde file extension.
#### Additional Reports
- https://forum.arduino.cc/t/why-some-library-examples-do-not-load-in-arduino-ide-2-0/1104079/1
- https://forum.arduino.cc/t/exmaple-not-loading/1069511
- https://forum.arduino.cc/t/in-version-2-0-0-i-cant-open-accelstepper-examples/1041358
- https://forum.arduino.cc/t/newping-librarys-example-code-wont-open/1036177
- https://forum.arduino.cc/t/ds3231-of-example-frome-custom-libraries-is-not-open/934173
- https://forum.arduino.cc/t/ide-wont-load-sketches/1112447
<a name="workaround"></a>
#### Workaround
Rename the example sketch to use the `.ino` file extension.
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the problem still occurs when using the latest [nightly build](https://www.arduino.cc/en/software#nightly-builds)
- [X] My report contains all necessary details
hizon
September 27, 2022, 2:51pm
10
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.
system
Closed
March 26, 2023, 3:51pm
12
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.