Trying the standard Arduino BLINK sketch in my first investigation of Sloeber, I see that the basic Arduino IDE variables: "OUTPUT", "HIGH" & "LOW" are not recognised. However, the sketch will still compile & upload.
Is this expected?
I see that the basic Arduino IDE variables: "OUTPUT", "HIGH" & "LOW" are not recognised.
OUTPUT, HIGH, and LOW are NOT variables.
Will the attached image illustrate my problem?
If I add this include, errors go away.
** #include </opt/sloeber/arduinoPlugin/packages/arduino/hardware/avr/1.6.15/cores/arduino/Arduino.h>**
Then, with a bit more poking about… use the drop-down menu Arduino | Reattach Libraries
(quite why/how a library becomes unattached, I don’t know. But it must happen often enough for the author to add a menu option to fix it?)
Why do you add the whole path an not just "Arduino.h"?
In stable version 3.1 the reattach libraries is still there just in case. Reattaching libraries is needed and happens automagically when you switch boards.
The stuff is far more complicated than it looks at first sight.
In the arduino IDE, and in all of the arduino code that you might get from somewhere else, that #include is not necessary. Obviously, it's just an annoyance to add it, so not too serious. Is there a plan to someday make that #include taken care of an invisibly? (Yes, I do appreciate that this stuff is complicated. Thanks for your work, Janje)
In the arduino IDE, and in all of the arduino code that you might get from somewhere else, that #include is not necessary
- The include is not necessary. The code compiles fine without it.
- The Arduino IDE (I do not know about the others) do not offer the indexer functionality (Like write time code validation) that makes for the "need" to include Arduino.h.
- Support for .ino files is there for 2 reasons. 1 to make the examples work and 2 to allow library developers to create examples. .ino files is not my advised way to go.
- This issue only exist if you have no arduino library includes at all. This because nearly all Arduino libraries include "Arduino.h". So it is only a minor inconvenience for simple example programs which is not the usage for Sloeber.
- If I add #include Arduino.h to the code automagically some people will say Sloeber needs it and will complain about this.
So basically there is no way to win this for me.