pdf-icon

Arduino Quick Start

Capsule Buzzer

M5Capsule Buzzer Buzzer related APIs and case programs.

Example

cpp
1 2 3 4 5 6 7 8 9 10 11 12 13
#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);
}

API

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:

On This Page