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