「App:IDE:Visual Studio Code」の版間の差分
提供: robot-jp wiki
ナビゲーションに移動検索に移動 (→動作確認手順) |
(→インストール) |
||
17行目: | 17行目: | ||
|- | |- | ||
|ESP-IDF をインストール (Espressif IoT Development Framework) | |ESP-IDF をインストール (Espressif IoT Development Framework) | ||
− | |[[file:VSCode ESP-IDF install.jpg| | + | |[[file:VSCode ESP-IDF install.jpg|350px]] |
|CPUモジュールのメーカーであるEspressifの | |CPUモジュールのメーカーであるEspressifの | ||
25行目: | 25行目: | ||
|- | |- | ||
|PlatformIO をインストール | |PlatformIO をインストール | ||
− | |[[file:VSCode PlatformIO install.jpg| | + | |[[file:VSCode PlatformIO install.jpg|350px]] |
|PlatformIOはプロジェクトを作るのに必要なため | |PlatformIOはプロジェクトを作るのに必要なため | ||
38行目: | 38行目: | ||
|- | |- | ||
|Japanese Language Pack をインストール | |Japanese Language Pack をインストール | ||
− | |[[file:VSCode japanese install.jpg| | + | |[[file:VSCode japanese install.jpg|350px]] |
|VSCodeを日本語表示にする場合にインストール | |VSCodeを日本語表示にする場合にインストール | ||
49行目: | 49行目: | ||
|- | |- | ||
|Arduino for Visual Studio Code をインストール | |Arduino for Visual Studio Code をインストール | ||
− | |[[file:VSCode Aduino install.jpg| | + | |[[file:VSCode Aduino install.jpg|350px]] |
|Arduino スケッチの開発~デバッグのための機能一式。 | |Arduino スケッチの開発~デバッグのための機能一式。 | ||
2022年6月16日 (木) 17:31時点における版
Arduino IDEをインストール
※Arduino IDEの機能を使うためインストール済である必要があります。
VSCodeをダウンロード&インストール (Windows10)
ダウンロード
https://azure.microsoft.com/ja-jp/products/visual-studio-code/
インストール
設定変更
Arduino Path "C:\Program Files (x86)\Arduino" Intelli sense engine Tag Perserに設定 文字化け対策
VSCoreが起動したままの状態で
C:\Users\(ユーザー名)\.vscode\extensions\vsciot-vscode.vscode-arduino-0.4.11\out\src\common\util.js
をダブルクリックしてVSCoreで開く。
210行目辺りの次の部分をコメントアウトする。//codepage = chcp.toString().split(":").pop().trim();
これで解決するはずだけど、ダメなら205~218行の範囲を全てコメントアウトする。
終わったらCTRL+Sで保存する。参考HP1:1行だけコメントアウト
動作確認手順
動作確認
簡単なプログラムで試しに動作確認をします。
VSCodeは汎用のEditorであるため、Arduino言語を使うためには追加のヘッダを取り込む必要があります。
おまじない的に常に先頭に"#include <Arduino.h>"を追加しておけば無難です。
例
#include <Arduino.h> int i;
void setup() {
- Serial.begin(9600);
- Serial.println("--Start--");
}
void loop() {
- Serial.println(i++);
- delay(1000);
}
補足
設定やライブラリはArduino IDEの設定が引き継がれます。(VSCode上でもライブラリの追加は可能)
チュートリアル