ESP8266Audio icon indicating copy to clipboard operation
ESP8266Audio copied to clipboard

where do we define sd pins for sd example?

Open manecolooper opened this issue 3 years ago • 3 comments

hi, i'm trying to test sd flac example with esp32, and don´t know where to define pins for sd card, i'm using a ttgo 1.7 that has CS 13 , MOSI 15 , SCK 14 and MISO 2 thanks!

manecolooper avatar Dec 20 '20 21:12 manecolooper

hi, i'm trying to test sd flac example with esp32, and don´t know where to define pins for sd card, i'm using a ttgo 1.7 that has CS 13 , MOSI 15 , SCK 14 and MISO 2 thanks!

Hi, I have the same problem. Have you figured this out?

blaudp79 avatar Feb 20 '21 05:02 blaudp79

I got mine working with the following:

// SPI pins for SD card
#define SCK  7
#define MISO  6 
#define MOSI  5
#define CS  4

SPIClass spi = SPIClass(FSPI);

void setup(){
  spi.begin(SCK, MISO, MOSI, CS);
  pinMode(spi.pinSS(), OUTPUT);
  if(!SD.begin(CS, spi, SPI_SPEED)){
      Serial.println("Card mount failed!");
  }
}

I've omitted the rest of the garbage from my setup function

Kriegbaum avatar Aug 15 '22 15:08 Kriegbaum

For Reference, I dont think the pins are included in the callout (as a #define) because it assumes you are using the default SPI pins on the board.

CobaltEcho avatar Aug 20 '23 01:08 CobaltEcho