Windows10でM5Stack開発環境構築を行った際の手順を記載します。
VSCodeにArduino機能拡張を導入します。
(Arduino IDE導入&VSCode導入は完了しているものとします。VSCode ver1.57.1)
(2021/6/21時点)
1. Arduino for Visual Studio Code をインストール
「Extensions」を選択し、検索窓に"arduino" と入力し、
Microsoft社のArduinoを選択してインストールします。
2. Arduino for Visual Studio Code初期設定
- 2-1.Path設定
[ファイル]→[ユーザ設定]→[設定] を選択します。 - 2-2.IntelliSense (C/C++ 拡張機能)の初期設定
- 2-3.ターミナルのコンパイル出力文字化け対策
以下のJavaScriptファイルを編集します
C:\Users\username\.vscode\extensions\vsciot-vscode.vscode-arduino-0.4.3\out\src\common\util.js
3. Arduinoプロジェクト作成
-
3-1. プロジェクトフォルダ作成
-
3-2. ボード種類選択
-
3-3. C/C++拡張機能のパス追加
4. M5Stack への書き込み
- 4-1. シリアルポートの設定
- M5StackをUSB接続する
- Ctrl+Shift+P にて、「Arduino : Select Serial Port」 を選択する
- Silicon Labsを認識しているCOMポートを選択する
-
4-2. コンパイル実施
-
4-3. M5Stackへ書き込み
M5Stackの液晶画面にHello World
が表示されれば成功です!