Skip to content

Commit 6a9d403

Browse files
committed
edit the I2S - simple tone example
1 parent dd096e2 commit 6a9d403

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: libraries/ESP_I2S/examples/Simple_tone/Simple_tone.ino

+6-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030

3131
#include <ESP_I2S.h>
3232

33+
// In fact, the GPIO pins are not fixed, most other pins can be used for the I2S function.
34+
#define LRC 25
35+
#define BCLK 5
36+
#define DIN 26
37+
3338
const int frequency = 440; // frequency of square wave in Hz
3439
const int amplitude = 500; // amplitude of square wave
3540
const int sampleRate = 8000; // sample rate in Hz
@@ -49,7 +54,7 @@ void setup() {
4954
Serial.begin(115200);
5055
Serial.println("I2S simple tone");
5156

52-
i2s.setPins(5, 25, 26);
57+
i2s.setPins(BCLK, LRC, DIN);
5358

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

0 commit comments

Comments
 (0)