LoginSignup
0
1

More than 5 years have passed since last update.

Arduino IDE > 別のタブで実装した関数はincludeしなくても参照できるようだ

Last updated at Posted at 2016-02-16

AQM0802用のライブラリを実装中。

1つのタブ(inoファイル)で実装をすると今後流用しにくいためソース分割をしている。

Arduino IDEにおいてウィンドウ右上の虫眼鏡の下の「下矢印」を押して表示される「新規タブ」。これを選択してファイルをAQM0802lib.inoなどにすると、その名前のタブが追加される。

qiita.png

新規タブ内の実装を以下とする。

AQM0802lib.ino
void AQM0802_clear()
{
   // clear operation
}

上記関数は 別inoファイル (esp8266_160217_AQM0802.inoなど)において AQM0802lib.ino をinclude宣言せずに使える。

esp8266_160217_AQM0802.ino

void setup()
{
    // some setup other than AQM0802

    AQM0802_clear();
}

プロジェクトに組み込まれたタブ(inoファイル)を全部使えるのがいいのか悪いのかはよく分からない。

0
1
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
1