Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By Jonas N
#34282 Hi.

Using redflag2k's sketch, I managed to get my setup play very unstable webradio for 2-30 seconds. It is stuttering several times a second, and at the end a little silent break, then some sound again, and then the audio stops. It seems that the system stops working, and either it keeps writing "await_data_request" in the serial monitor, without responding to anything, or stops/freezes totally.

I guess it's some kind of buffer and/or clock and/or delay problem? How to debug this?

My setup:
NodeMCU with ESP8266-chip, programmed via Arduino IDE, connected to "LC Technology VS1003/1053"-board.

My project: I am trying to make a webradio to build into my shower, which can be controlled by hand claps. (2 claps: Start/Stop, 3 claps: Next station, 4 to 10 claps: Volume).

Thank you for any help.
User avatar
By SM7I
#58454 Does anyone know how to change the registers of the following snippet to play WAV(PCM) instead of MP3 ?

void modeSwitch(void)
{
//GPIO_DDR
write_register(SCI_WRAMADDR, 0xc017);
write_register(SCI_WRAM, 0x0003);
//GPIO_ODATA
write_register(SCI_WRAMADDR, 0xc019);
write_register(SCI_WRAM, 0x0000);

delay(1);
write_register(SCI_MODE, (1<<SM_SDINEW) | (1<<SM_RESET));
delay(1);
}
User avatar
By SM7I
#59208 Solved the problem myself. The solution was simpler than I thought of initially :) I just send a waveheader as the initial part of the stream, in a special manner, and it sets the VS1053 unit i PCM mode indefinitely or reset is sent.