Hi Guys,
I have a core S3 that I am trying to program via the Arduino IDE as UiFlow 2 is missing a lot of the capabilites for the S3.
I have also tried this with a standard ESp32 S3 board and get the same issue but could do with some guidance.
My Code:
// Include required libraries
#include "M5CoreS3.h"
#include "Arduino.h"
#include "Audio.h"
#include "SD.h"
#include "FS.h"
// microSD Card Reader connections
#define SD_CS 15
#define SPI_MOSI 37
#define SPI_MISO 35
#define SPI_SCK 36
// I2S Connections
#define I2S_DOUT 39
#define I2S_BCLK 40
#define I2S_LRC 41
// Create Audio object
Audio audio;
void setup() {
M5.begin();
// Set microSD Card CS as OUTPUT and set HIGH
pinMode(SD_CS, OUTPUT);
digitalWrite(SD_CS, HIGH);
// Initialize SPI bus for microSD Card
SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
USBSerial.print("MOSI: ");
USBSerial.println(MOSI);
USBSerial.print("MISO: ");
USBSerial.println(MISO);
USBSerial.print("SCK: ");
USBSerial.println(SCK);
USBSerial.print("SS: ");
USBSerial.println(SS);
SPIClass SPI1(HSPI);
// Start microSD Card
if(!SD.begin(SD_CS, SPI1))
{
USBSerial.println("Error accessing microSD card!");
while(true);
}
// Setup I2S
audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT);
USBSerial.println("Pinout Set!");
// Set Volume
audio.setVolume(5);
USBSerial.println("Volume Set Set!");
// Open music file
audio.connecttoFS(SD,"/demo.mp3");
USBSerial.println("File Open!");
}
void loop()
{
audio.loop();
}
Basically, I keep getting the message "Error accessing microSD card!" on the terminal. Pretty sure I have the pins right? And the card is formatted to FAT32.
For some reason, I just cannot get it to read
Any Ideas?
Thanks