Bodmer / TFT_HX8357

Arduino library for HX8357 TFT display
118 stars 52 forks source link

reference to 'SD' is ambiguous error #7

Closed lana726 closed 7 years ago

lana726 commented 7 years ago

Hi,

I'm trying to run the Draw_SDCard_Bitmap example but I keep getting this error message. screen shot 2016-10-12 at 1 51 37 am

Bodmer commented 7 years ago

Thanks for reporting this. Only one SD library should be used ( SD or SdFat) and I see both are called up in the example, I have corrected this in the example on GitHub. Either use:

// SD Card library, comment out next line if the SdFat library is used
#include <SD.h>

// We can use the SdFat library instead and it will be a bit faster, uncomment next 2 lines
//#include <SdFat.h>           // Use the SdFat library for the Due
//SdFat SD;                    // Permit SD function call compatibility with no sketch changes :-)

Or:

// SD Card library, comment out next line if the SdFat library is used
//#include <SD.h>

// We can use the SdFat library instead and it will be a bit faster, uncomment next 2 lines
#include <SdFat.h>           // Use the SdFat library for the Due
SdFat SD;                    // Permit SD function call compatibility with no sketch changes :-)

Does that fix the error message?

Bodmer commented 7 years ago

Sorry if you got multiple replies, had trouble getting the code markup syntax right!

lana726 commented 7 years ago

Hi thanks so much for that, I believe that has fixed the problem however I am now getting a new error message. Sorry I'm fairly new to this. "'File' was not declared in this scope" screen shot 2016-10-12 at 9 14 29 pm

Bodmer commented 7 years ago

The compiler is not finding an SD library. Make sure the following line is not commented out:

#include <SD.h>

Comment out the following 2 lines in the sketch thus:

//#include <SdFat.h>
//SdFat SD;