Hi,
I am trying to load icons off of an SD card to display on my TFT LCD display. I am using Display 5 inch TFT Arduino Touch Shield w/SSD1963 for Mega/Due.
I am using UTFT_SdRaw supplied by ghlawrence2000 to do this. I have tried with both the Due and the Mega2560 but no matter what I always get this message:
"Initialising SD card...
Card failed, or not present
Retrying...."
I have spent 3 days now with this issue, reading forum post after forum post in an attempt to figure out what I am missing but to no avail.
Here is a sample of my code
#include <SPI.h>
#include <SdFat.h>
#include <UTFT.h>
#include <UTFT_SdRaw.h>
#define SD_CHIP_SELECT 53 // SD chip select pin
// file system object
SdFat sd;
UTFT myGLCD(SSD1963_800480,38,39,40,41);
UTFT_SdRaw myFiles(&myGLCD);
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect.
}
Serial.println(F("Initialising SD card..."));
bool mysd = 0;
// see if the card is present and can be initialized:
while (!mysd)
{
if (!sd.begin(SD_CHIP_SELECT, SPI_FULL_SPEED)) {
Serial.println(F("Card failed, or not present"));
Serial.println(F("Retrying...."));
}
else
{
mysd = 1;
Serial.println(F("Card initialised."));
}
}
Serial.println(F("Initialising LCD."));
myGLCD.InitLCD();
myGLCD.clrScr();
//myGLCD.setFont(SmallFont);
Serial.println(F("LCD initialised."));
myFiles.load(0, 0, 240, 240, "wait4gps.RAW", 1 , 1);
}
void loop()
{}