sketch\sketch_distance.ino.cpp:1:10: fatal error: Arduino.h: No such file or directory
#include <Arduino.h>
^~~~~~~~~~~
compilation terminated.
exit status 1
Error compiling for board Arduino Nano Every.
I note in the forum this has been mentioned several times. I tried the fix mentioned by "peat" to add some text to the Print.h file but this did not help.
I do not think it is a problem with the sketch as it uploads to the Nano Every and works when I upload it from Web site. I would like to be able to load it directly from my computer. Is there a solution?
I am using a Windows computer. i am a beginner with Arduino programing, just started to learn 2 months ago.
I have not had any problems using the Arduino Uno.
You're right that there is a bug in the 1.8.6 release of Arduino megaAVR Boards that causes compilation of sketches using the LiquidCrystal library to fail. However, that bug causes a different error, like "error: 'Print' has not been declared".
So I think this is a different issue causing your "Arduino.h: No such file or directory" error.
Please try compiling this simple sketch and then let me know whether you get the same error:
sketch\sketch_nov28a.ino.cpp:1:10: fatal error: Arduino.h: No such file or directory
#include <Arduino.h>
^~~~~~~~~~~
compilation terminated.
exit status 1
Error compiling for board Arduino Nano Every.
But also, why does the upload work from the "Create" website. The only difference I see is that LiquidCrystal in the #include statement is black instead of red. Screen shot enclosed:
OK, so this proves the issue is unrelated to the LiquidCrystal bug. It may be that the Arduino megaAVR Boards platform installation is incomplete or damaged. I'll recommend that you remove and then reinstall it to see if this fixes the issue:
Tools > Board > Boards Manager
Wait for the update to finish.
From the list of boards platforms, click on "Arduino megaAVR Boards".
Click the "Remove" button.
Wait for the removal to finish.
From the list of boards platforms, click on "Arduino megaAVR Boards".
Click the 'Install" button.
Wait for the installation to finish.
Click the "Close" button.
Try compiling that minimal test sketch I provided again.
rsstarkmd:
But also, why does the upload work from the "Create" website.
Because when you compile a sketch using the Create website, the compilation is happening on Arduino's server in the cloud, so a completely separate set of files and tools are used from the local ones installed on your computer that the Arduino IDE uses. This means that a completely broken installation on your computer has no effect on the compilation via Create.
rsstarkmd:
The only difference I see is that LiquidCrystal in the #include statement is black instead of red.
That's no problem. Arduino Create uses a different, and far more primitive, method for keyword highlighting than the Arduino IDE. I recommend that you don't assign any special meaning to the colors of things in either tool, since even the Arduino IDE's keywords highlighting system is not very good.