pdf-icon

Buzzer

M5Capsule Buzzer Buzzer related APIs and case programs.

Example

#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