Skip to content

Fix(I2S example): make fix to the ESP32 I2S simple tone example #10954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jun 10, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
edit the I2S - simple tone example
  • Loading branch information
greenyleaf committed Mar 8, 2025
commit 6a9d40379cd2664246edaf3792be2dd00d90a193
7 changes: 6 additions & 1 deletion libraries/ESP_I2S/examples/Simple_tone/Simple_tone.ino
Original file line number Diff line number Diff line change
@@ -30,6 +30,11 @@

#include <ESP_I2S.h>

// In fact, the GPIO pins are not fixed, most other pins can be used for the I2S function.
#define LRC 25
#define BCLK 5
#define DIN 26

const int frequency = 440; // frequency of square wave in Hz
const int amplitude = 500; // amplitude of square wave
const int sampleRate = 8000; // sample rate in Hz
@@ -49,7 +54,7 @@ void setup() {
Serial.begin(115200);
Serial.println("I2S simple tone");

i2s.setPins(5, 25, 26);
i2s.setPins(BCLK, LRC, DIN);

// start I2S at the sample rate with 16-bits per sample
if (!i2s.begin(mode, sampleRate, bps, slot)) {