Ubuntu 18.04.2 LTS
An hourly build of Arduino 1.8.10 from about May 25-30th (rock solid on its own)
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"${HOME}/Arduino/libraries/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}



Not sure what I did since yesterday, but I did have most of it working except these two libraries to include:
https://github.com/nickgammon/bitBangedSPI
https://github.com/nickgammon/MAX7219_Dot_Matrix
Here are a few pointers, someone helped me with mine.
Not sure what you mean on item 2.
Check on 1, 3, 5 and 5. I'm using the same version.
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"${HOME}/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/**",
"${HOME}/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/libraries/**",
"${HOME}/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/sdk/include/**",
"${HOME}/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/sdk/lwip2/include/**",
"${HOME}/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/tests/host/**",
"${HOME}/Arduino/libraries/bitBangedSPI-master/**",
"${HOME}/Arduino/libraries/MAX7219_Dot_Matrix-master/src/**",
"${HOME}/Arduino/libraries/DHT_sensor_library_for_ESPx/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
> Executing task in folder LED_matrix: /usr/bin/g++ -g /home/supaplex/Downloads/LED_matrix/led-matrix-vs-vscode.cpp -o /home/supaplex/Downloads/LED_matrix/led-matrix-vs-vscode <
/home/supaplex/Downloads/LED_matrix/led-matrix-vs-vscode.cpp:1:10: fatal error: Arduino.h: No such file or directory
#include <Arduino.h>
^~~~~~~~~~~
compilation terminated.
The terminal process terminated with exit code: 1
md5-2c1578cf07a11865b6b3c372f7ebd767
supaplex@supaplex-gtx760m:~$ find / -name Arduino.h -ls 2>/dev/null
43129352 8 -rw-r--r-- 1 root root 5844 Dec 8 2016 /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h
43129392 8 -rw-r--r-- 1 root root 5844 Dec 8 2016 /usr/share/arduino/hardware/arduino/cores/robot/Arduino.h
6970453 8 -rw-rw-r-- 1 supaplex supaplex 7483 Sep 10 2018 /home/supaplex/usr/src/Arduino/build/linux/work/hardware/arduino/avr/cores/arduino/Arduino.h
7609587 12 -rw-r--r-- 1 supaplex supaplex 9141 May 20 11:56 /home/supaplex/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/tests/host/common/Arduino.h
7609460 12 -rw-r--r-- 1 supaplex supaplex 9528 May 20 11:56 /home/supaplex/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/Arduino.h
395832 12 -rw-r--r-- 1 supaplex supaplex 9141 May 20 11:56 /home/supaplex/.platformio/packages/framework-arduinoespressif8266/tests/host/common/Arduino.h
397484 12 -rw-r--r-- 1 supaplex supaplex 9528 May 20 11:56 /home/supaplex/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/Arduino.h
Search for the "arduino.h" and inculd that path.
For item 2. The compiler us have usr/.. i guess if you are using linux thats were it would be , which might be correct.
Terse sample code at https://gist.github.com/supaplextor/1f1b32ba9849a0144ae3d426a1f9510c to reproduce the same issue. Builds , uploads and runs okay in Arduino 1.8.10. Should I retry with 1.8.8?
Board is a nodemcu v1 clone running ESP8266EX.
vscode has squiggles for WProgram.h in /home/supaplex/Arduino/libraries/DHT_sensor_library_for_ESPx/DHTesp.h. Based on line 46 there it looks like ARDUINO is one reason why. Depending on how I edit .vscode/c_cpp_properties.json I get up to three references for Arduino.h.
#if ARDUINO < 100
#include <WProgram.h>
#else
#include <Arduino.h> // greyed out
#endif
Edit: now on Arduino 1.8.8. Same issue.
Current c_cpp_properties.json
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"${HOME}/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266/**",
"${HOME}/Arduino/libraries/bitBangedSPI-master/**",
"${HOME}/Arduino/libraries/MAX7219_Dot_Matrix-master/src/**",
"${HOME}/Arduino/libraries/DHT_sensor_library_for_ESPx/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
If I define ARDUINO just as the shell is using during build, it will build, and no squiggles on header files now. Ugly hack :) ...
#define ARDUINO 10808
#include <Arduino.h>
#include <DHTesp.h>
DHTesp dht;
void setup() {
Serial.begin(115200);
dht.setup(D5, DHTesp::DHT11);
}
float temp = 0;
float ltemp = 1;
void loop() {
delay(25);
temp = dht.getTemperature();
if ((!isnan(temp)) && (ltemp != temp)) {
Serial.printf("%0.1f F\n", dht.toFahrenheit(temp));
Serial.printf("%0.1f humidity\n", dht.getHumidity());
if (temp != ltemp) {
ltemp = temp;
}
}
}
/* Sample Serial output (with timestamps enabled on monitor)
10:11:05.541 -> 80.6 F
10:11:05.541 -> 16.0 humidity
10:19:00.347 -> 78.8 F
10:19:00.347 -> 16.0 humidity
*/

arduino.json:
{
"port": "/dev/ttyUSB0",
"board": "esp8266:esp8266:nodemcuv2",
"configuration": "xtal=80,vt=flash,exception=disabled,ssl=all,eesz=4M3M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200",
"sketch": "dht11-barebones.ino"
}
c_cpp_properties.json:
{
"configurations": [
{
"name": "Linux",
"includePath": [
"/home/supaplex/.arduino15/packages/esp8266/tools/**",
"/home/supaplex/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/**",
"${workspaceFolder}/**",
"/home/supaplex/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/tests/host/common",
"/home/supaplex/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/tests/host",
"/home/supaplex/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/sdk/include",
"/home/supaplex/Arduino/libraries/DHT_sensor_library_for_ESPx/**",
"/home/supaplex/Arduino/libraries/MD_MAX72XX/src",
"/home/supaplex/Arduino/libraries/MD_Parola/src",
"/home/supaplex/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/cores/esp8266"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64",
"forcedInclude": []
}
],
"version": 4
}
settings.json
{
"arduino.additionalUrls": [
"https://raw.githubusercontent.com/VSChina/azureiotdevkit_tools/master/package_azureboard_index.json",
"http://arduino.esp8266.com/stable/package_esp8266com_index.json"
],
"C_Cpp.errorSquiggles": "Enabled",
}
I see... What a hack!!!
Q: Did you have to add the Arduino extension?
It's installed. (tossing some screenshots for the next guy)

Had to adjust the Arduino path. I cleaned up the hourly build of Arduino, installed 1.8.8 to /usr/local/bin/arduino-1.8.8. The hourly build was rock solid, but I moved back to go along with the vscode install instructions.

User Settings (hit F1)

Version: 1.35.1
Commit: c7d83e57cd18f18026a8162d042843bda1bcf21f
Date: 2019-06-12T14:27:31.086Z
Electron: 3.1.8
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Linux x64 4.15.0-50-generic
This issue has been automatically marked as stale and closed because it has not had recent activity. Please feel free to open a new issue if you would like further discussion. Thank you for your contributions.
I can still reproduce this with the latest release of both the app and the extension on Arch Linux.
This is due to the improper IntelliSense implementation of vscode-arduino. I'm currently working on this and a beta should be available soon at least for OSX and Linux. Windows will follow.
Anyone interested can track the progress here and I often report to issue #438 as well.
Regards
EW
Any news about this? I still can reproduce it with the latest version.
this should be resolved once #1141 is merged. I expect it to be later this week.