Arduino Quick Start
CoreS3 Speaker related APIs and case programs.
#include "M5CoreS3.h" void setup() { auto cfg = M5.config(); CoreS3.begin(cfg); CoreS3.Display.setRotation(1); CoreS3.Display.setTextColor(GREEN); CoreS3.Display.setTextDatum(middle_center); CoreS3.Display.setTextFont(&fonts::Orbitron_Light_24); CoreS3.Display.setTextSize(1); CoreS3.Display.drawString("Speaker Test", CoreS3.Display.width() / 2, CoreS3.Display.height() / 2);} void loop() { CoreS3.Speaker.tone(10000, 100); delay(1000); CoreS3.Speaker.tone(4000, 20); delay(1000);}
The M5CoreS3 library is based on the M5Unified library, the Speaker part of the driver uses the Speaker_Class
in the M5Unified library, for more related APIs you can refer to the following document: