I2S with CrowPanel 4.3'' HMI

Can somebody please provide the correct PinOut for playing audio files via I2S speaker port ?
I can find any SDOUT port in the documentation .

Thanks in advance

regards
oliver

Comments

  • By the way even the sample code in the Tutorial "Play music" throws the error "Invalid Pin"

  • Having adjusted to the correct PINs i encounter WAV files are not playable via I2S neither STERO nor MONO .
    It crashes with
    Guru Meditation Error: Core 1 panic'ed (IntegerDivideByZero). Exception was unhandled.

  • edited April 14

    Hi oliver,
    Our technical support team is currently looking into your issue in your post. Please be patient, and we will get back to you as soon as possible.

    If you have any additional questions, feel free to ask us.

    Best regards,

  • edited April 15

    Hi Oliver,
    Regarding your issue, please refer to the image below and try the following code(please put the code in an .ino file).

    #include <Wire.h>
        #include <SPI.h>
        #include <SD.h>
        #include <FS.h>
        #include "Audio.h"
        Audio audio;
    
        #define I2S_DOUT      20
        #define I2S_BCLK      35
        #define I2S_LRC       19
    
        //4.3
        #define SD_MOSI 11
        #define SD_MISO 13
        #define SD_SCK 12
        #define SD_CS 10
    
        void setup() {
          // put your setup code here, to run once:
          Serial.begin( 9600 ); /*初始化串口*/
          pinMode(SD_CS, OUTPUT);      digitalWrite(SD_CS, HIGH);
          SPI.begin(SD_SCK, SD_MISO, SD_MOSI);
          SPI.setFrequency(1000000);
          SD.begin(SD_CS);
          audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT);
          audio.setVolume(21); // 0...21
          audio.connecttoFS(SD, "/123.mp3");
        }
    
        void loop() {
          // put your main code here, to run repeatedly:
          audio.loop();
          //audio.stopSong();//关闭
        }
    
Sign In or Register to comment.