SdFile.h error

Hello,

I'm doing a project that uses sound outputs. I found a library in the internet (GitHub - TMRh20/TMRpcm: Arduino library for asynchronous playback of PCM/WAV files direct from SD card. Arduino Uno,Nano,Mega etc supported) and used the available code, which is:

#include <SD.h>                      // need to include the SD library
//#define SD_ChipSelectPin 53  //example uses hardware SS pin 53 on Mega2560
#define SD_ChipSelectPin 10  //using digital pin 4 on arduino nano 328
#include <TMRpcm.h>           //  also need to include this library...

TMRpcm tmrpcm;   // create an object for use in this sketch
char mychar;

void setup(){

  tmrpcm.speakerPin = 9; //11 on Mega, 9 on Uno, Nano, etc

  Serial.begin(9600);
  if (!SD.begin(SD_ChipSelectPin)) {  // see if the card is present and can be initialized:
    Serial.println("SD fail");  
    return;   // don't do anything more if not
  }
  tmrpcm.play("beware.wav"); //the sound file "music" will play each time the arduino powers up, or is reset
}

void loop(){  

  if(Serial.available()){   
    mychar = Serial.read();

    if(mychar == 'o'){ //send the letter p over the serial monitor to start playback
      tmrpcm.play("helpyou.wav");
    } else if(mychar == 'r'){ //send the letter p over the serial monitor to start playback
      tmrpcm.play("chortle.wav");
    } else if(mychar == 'q'){ //send the letter p over the serial monitor to start playback
      tmrpcm.play("helpyou.wav");
    } else if(mychar == 'p'){
      tmrpcm.play("beware.wav");
    }
    else if(mychar == 'w'){ //send the letter p over the serial monitor to start playback
      tmrpcm.play("impresiv.wav");
    }
    else if(mychar == 't'){ //send the letter p over the serial monitor to start playback
      tmrpcm.play("seekyoda.wav");
    }
    else if(mychar == 'y'){ //send the letter p over the serial monitor to start playback
      tmrpcm.play("sensefear.wav");
    }
    else if(mychar == 'u'){ //send the letter p over the serial monitor to start playback
      tmrpcm.play("strongami.wav");
    }
    else if(mychar == 'i'){ //send the letter p over the serial monitor to start playback
      tmrpcm.play("whyhere.wav");
    }
  }

}

Basically, it receives an input from the keyboard and plays an audio file stored in microSD attached to the Arduino Board through a shield.

I installed the library and it went OK. However, when I try to compile it, it tells me that a fatal error occurred and that SdFile.h is missing, even though it's not!

Did anybody have this error already?

I'm using Arduino Uno.

Thank you.

TMRpcm can be configured to use SD.h or SdFat to access the SD card. It appears you have selected SdFat.

It looks like the symbol SDFAT is defined in pcmConfig.h. If you don't want to use SdFat, remove the define for the symbol SDFAT.

Here are the options Advanced Features · TMRh20/TMRpcm Wiki · GitHub.

The SD.h library is a wrapper for an old version of SdFat but you can not directly use that version of SdFat. To use SdFat you must install the SdFat library GitHub - greiman/SdFat: Arduino FAT16/FAT32 exFAT Library.