We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd096e2 commit 6a9d403Copy full SHA for 6a9d403
libraries/ESP_I2S/examples/Simple_tone/Simple_tone.ino
@@ -30,6 +30,11 @@
30
31
#include <ESP_I2S.h>
32
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
+
38
const int frequency = 440; // frequency of square wave in Hz
39
const int amplitude = 500; // amplitude of square wave
40
const int sampleRate = 8000; // sample rate in Hz
@@ -49,7 +54,7 @@ void setup() {
49
54
Serial.begin(115200);
50
55
Serial.println("I2S simple tone");
51
56
52
- i2s.setPins(5, 25, 26);
57
+ i2s.setPins(BCLK, LRC, DIN);
53
58
59
// start I2S at the sample rate with 16-bits per sample
60
if (!i2s.begin(mode, sampleRate, bps, slot)) {
0 commit comments