pdf-icon

Arduino Quick Start

2. Devices & Examples

6. Applications

Dial Buzzer

APIs and example programs related to the Dial Buzzer.

Example Program

Build Requirements

  • M5Stack board manager version >= 3.2.2
  • Board option = M5Dial
  • M5Dial library version >= 1.0.3
cpp
1 2 3 4 5 6 7 8 9 10 11 12 13
#include "M5Dial.h"

void setup() {
  auto cfg = M5.config();
  M5Dial.begin(cfg, false, false);  // encoder, RFID
}

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

API

The M5Dial library is built on top of the M5Unified library. The buzzer driver uses the Speaker_Class provided by M5Unified. For more related APIs, please refer to the following document:

On This Page