Commit deab38e1 authored by Cellie's avatar Cellie

Fix the M5Stack Node example.

parent d44a6264
......@@ -16,9 +16,8 @@
#define I2S_DOUT 2
#define I2S_DIN 34
/* M5Stack WM8978 MCLK gpio number and frequency */
/* M5Stack WM8978 MCLK gpio number */
#define I2S_MCLKPIN 0
#define I2S_MFREQ (24 * 1000 * 1000)
WM8978 dac;
Audio audio;
......@@ -29,12 +28,13 @@ void setup() {
ESP_LOGE(TAG, "Error setting up dac. System halted");
while (1) delay(100);
}
/* Setup wm8978 MCLK on gpio - for example M5Stack Node needs a 24Mhz clock on gpio 0 */
dac.setPinClockFreq(I2S_MCLKPIN, I2S_MFREQ);
/* Setup wm8978 I2S interface */
audio.setPinout(I2S_BCK, I2S_WS, I2S_DOUT, I2S_DIN);
/* Setup wm8978 MCLK on gpio - for example M5Stack Node needs a 24Mhz clock on gpio 0 */
audio.i2s_mclk_pin_select(I2S_MCLKPIN);
WiFi.begin("xxx", "xxx");
while (!WiFi.isConnected()) {
delay(10);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment