pdf-icon

Arduino Quick Start

2. Devices & Examples

6. Applications

Fire Speaker

APIs and example programs related to the Fire speaker.

Example Program

Compilation Requirements

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

void setup() {
  M5.begin();
}

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

API

The Fire speaker uses the Speaker_Class from the M5Unified library. For more related APIs, please refer to the following documentation:

On This Page