pdf-icon

Arduino入門

2. デバイス&サンプル

6. アプリケーション

Unit C6L Buzzer

Unit C6L ブザーに関連する API とサンプルプログラムです。

サンプルプログラム

コンパイル要件

  • M5Stack ボードマネージャ バージョン >= 3.2.3
  • ボードオプション = M5UnitC6L
  • M5Unified ライブラリ バージョン >= 0.2.10
cpp
1 2 3 4 5 6 7 8 9 10 11 12
#include "M5Unified.h"

void setup() {
  M5.begin();
}

void loop() {
  M5.Speaker.tone(7000, 100);  // frequency, duration
  delay(1000);
  M5.Speaker.tone(4000, 20);  // frequency, duration
  delay(1000);
}

API

Unit C6L Buzzer のドライバは、M5Unified ライブラリ内の Speaker_Class を使用しています。関連する API の詳細については、以下のドキュメントを参照してください:

On This Page