vscode调用Arduino踩坑记

问题描述

安装arduino插件,然后打开arduino文件,提示找不到头文件和WProgram.h文件

解决方案

user的setting.json下添加以下设置可解决找不到WProgram.h文件的错误
"arduino.path": "C:/Program Files (x86)/Arduino/", "arduino.additionalUrls": "", "arduino.logLevel": "info", "arduino.enableUSBDetection": true, "C_Cpp.intelliSenseEngine": "Tag Parser"

在文件的c_cpp_properties.json中添加如下路径
``
“C:\Program Files (x86)\Arduino\tools\",
"C:\Program Files (x86)\Arduino\hardware\arduino\avr\
”,
“${workspaceFolder}/**”,
“C:/Program Files (x86)/Arduino/hardware/arduino/avr/cores/arduino/”,
“C:/Program Files (x86)/Arduino/hardware/arduino/avr/libraries/EEPROM/”,
“C:/Program Files (x86)/Arduino/hardware/arduino/avr/libraries/SPI/”,
“C:/Program Files (x86)/Arduino/hardware/arduino/avr/libraries/SoftwareSerial/”,
“C:/Program Files (x86)/Arduino/hardware/arduino/avr/libraries/Wire/”,
“C:/Program Files (x86)/Arduino/hardware/tools/avr/avr/include/”,
“C:/Program Files (x86)/Arduino/hardware/tools/avr/avr/include/avr/”,
“C:/Program Files (x86)/Arduino/hardware/tools/avr/avr/include/compat/”,
“C:/Program Files (x86)/Arduino/hardware/tools/avr/avr/include/util/”,
“C:/Program Files (x86)/Arduino/hardware/tools/avr/lib/gcc/avr/5.4.0/include/”,
“C:/Program Files (x86)/Arduino/hardware/tools/avr/lib/gcc/avr/5.4.0/include-fixed/”,
“C:/Program Files (x86)/Arduino/libraries/LedControl/src/”

参考

问题描述

编译arduino文件时出现乱码,更改console的编码未utf-8,gbk均没有用

问题解决

需要对C:\Users\username.vscode\extensions\vsciot-vscode.vscode-arduino-0.2.29\out\src\common路径下的util.js文件的第215行的编码判断语句进行注释
注意这个进队arduino1.8.9适用,其他版本好像没有这个问题

参考

你可能感兴趣的:(vscode,arduino)