ESP8266Audio icon indicating copy to clipboard operation
ESP8266Audio copied to clipboard

Added possibility to change DOUT pin.

Open frederic-bonjour opened this issue 5 years ago • 5 comments

Use AudioOutputI2S::DOUT = 27; before creating any instance of AudioOutputI2S.

If you use I2C as well, do not forget to add pull-up resistors on SDA and SCL lines to avoid any problem ;)

frederic-bonjour avatar Apr 27 '19 14:04 frederic-bonjour

Is there any reason why LRCLK and BCLK pins can't be changed as well? I think other pins on the ESP32 are capable and not all breakouts (like the HUZZAH32) provide access to the pins that are hard coded in the library - to me it makes more sense in usage if the pins can be optionally changed when the class is initialised, something like:

AudioOutputI2S *out;

void setup() {
    out = new AudioOutputI2S(15, 14, 32); // lrclk, bclk, dout
}

I don't know lots about the ESP32 or I2S but I could have a stab at making this change - I am very busy at the moment so I couldn't do it immediately

AidanTek avatar Jul 03 '19 11:07 AidanTek

You can change it fairly easily right after creating the "out" instance: out -> SetPinout(15, 14, 32);

Now it would be using those pins I believe.

meltdown03 avatar Jul 03 '19 14:07 meltdown03

You can change it fairly easily right after creating the "out" instance: out -> SetPinout(15, 14, 32);

Now it would be using those pins I believe.

I don't understand the purpose of the pull request in that case??

AidanTek avatar Jul 03 '19 15:07 AidanTek

Yeah, I guess it's not really needed as long as that works. I can test it later and let you know unless someone else wants to try it.

meltdown03 avatar Jul 03 '19 17:07 meltdown03

I tried it already

out -> SetPinout()

Works fine

Edit: just a thought but maybe a documentation PR would be helpful?

AidanTek avatar Jul 03 '19 17:07 AidanTek