0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

M5StickCPlus のビルド方法(Visual Studio Code + PlatformIO)

0
Posted at

M5StickCPlus のビルド方法

  • いつも忘れるのでメモ

ビルド方法

よくあるのは Arduino IDE ですが、あれは遅すぎるので、Visual Studio Code + PlatformIO を使おう。

Visual Studio Code をダウンロード/インストール

  1. https://code.visualstudio.com/download からダウンロードしてインストールする

PlatformIO IDE のインストール

  1. Visual Studio Code を起動する
  2. 左のバーから Extensions を選び、PlatformIO を検索
  3. インストール ボタンを押下する
    platformio.png

プロジェクトの作成

  1. Visual Studio Code を起動する

  2. 左のバーから PlatformIO を選ぶ
    start.png

  3. Create New Project を選び、+ New Project を選択し、プロジェクトを作成する

    • Name: に適当なプロジェクト名を
    • Board: は M5Stick-C (M5Stack) を選択し
    • Framework: は Arduino を選択する
      wizard.png
      Use default location の場合は、ドキュメント内の PlatformIO\Projects\LChika にプロジェクトが生成されます。
  4. Libraries を選択して、M5StickCPlus を探して Add します
    lib.png
    lib2.png

コーディング / ビルド

左ペインから src/main.cpp を選択して、コーディングします。
main.png

main.cpp
#include <M5StickCPlus.h>

void setup()
{
  M5.begin();
  pinMode(10, OUTPUT);
}

void loop()
{
  digitalWrite(10, HIGH);
  delay(1000);
  digitalWrite(10, LOW);
  delay(1000);
}

ビルドとアップロードはそれぞれのアイコンをクリックします。
build.png
upload.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?