Arduino Guide
M5Dial Buzzer related APIs and case programs.
#include "M5Dial.h"
void setup() {
auto cfg = M5.config();
M5Dial.begin(cfg, true, false);
}
void loop() {
M5Dial.Speaker.tone(10000, 100);
delay(1000);
M5Dial.Speaker.tone(4000, 20);
delay(1000);
}
The M5Dial library is based on the M5Unified library, the Buzzer part of the driver uses the Speaker_Class
in the M5Unified library, for more related APIs you can refer to the following document: