pdf-icon

Arduino入門

2. デバイス&サンプル

6. アプリケーション

Arduino Nesso N1 LED インジケーター

Arduino Nesso N1 の LED インジケーターに関する API およびサンプルプログラム。

サンプルプログラム

コンパイル要件

  • M5Stack ボードマネージャバージョン >= 3.2.5
  • ボードオプション = ArduinoNessoN1
  • M5GFX ライブラリバージョン >= 0.2.17
  • M5Unified ライブラリバージョン >= 0.2.11
cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include "M5Unified.h"

void setup() {
  auto cfg = M5.config();
  M5.begin(cfg);
}

void loop() {

  // LED_BUILTIN は E1.P7 に接続
  auto& ioe = M5.getIOExpander(1);
  ioe.digitalWrite(7, false);
  delay(1000);
  ioe.digitalWrite(7, true);
  delay(1000);
}
On This Page