Picture from SD card on the display

Hi guys,

For some esthetic reasons, I would like to show some picture from the SD card on my TFT display.

Everything works fin for the TFT display (which includes the SD card reader) to show the values of my measurements, to write and so on,
but I cannot manage to show picture from SD card.

I'm using the tinyFAT & UTFT_tinyFAT libraries.

My picture "1image48x60.raw" is on a SD card 2GB, on the root ( with other useless files)

Here is my code to test showing pictures ;

#include <tinyFAT.h> // used to acess the SD card
#include <UTFT_tinyFAT.h> // used to read .raw images from the SD card

#include <UTFT.h>
#include <URTouch.h>
#include <EEPROM.h>

UTFT myGLCD(ILI9486,38,39,40,41); //Parameters should be adjusted to your Display/Schield model CHECK DOCUMENTATION, TFT 480x320

UTFT_tinyFAT myFiles(&myGLCD); // start up an instance to read images from the SD card

//==== Defining Fonts
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];

void setup() {
// Initial setup
myGLCD.InitLCD();
myGLCD.clrScr();
myGLCD.fillScr(255,255,255);
file.initFAT();

file.setSSpin(53);

drawscreen ();}

void drawscreen () {

myGLCD.setBackColor(255, 255, 255);
myGLCD.setColor(0,0,0); // Sets color to white
myGLCD.setFont(BigFont); // Sets font to big
myGLCD.print("Hydro", 380, 10); // Prints the string on the screen

myFiles.loadBitmap(220, 100, 48, 63,"1image48x63.raw");

}

void loop() {

}

A weird thing is that the display shows the myGLCD.print("Hydro", 380, 10) ONLY if I put as comment all the SD functions, with the SD function, my display does not write anything.

As always, it's hard to get beautiful :smiley:

Thank you for any help !

I tried with another library SDFat & UTFT_SdRaw.h

And it works but not well, it changes color of pictures, and I cannot find any information about the possible functions

#include <SPI.h>

#include <SdFat.h>
#include <UTFT.h>
#include <URTouch.h>
#include <UTFT_SdRaw.h>
extern uint8_t SmallFont[];
extern uint8_t BigFont[];

#define SD_CHIP_SELECT 53 // SD chip select pin
// file system object
SdFat sd;
// print stream
//ArduinoOutStream cout(Serial);

UTFT myGLCD(ILI9486, 38, 39, 40, 41);

UTFT_SdRaw myFiles(&myGLCD);

void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
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.fillScr(255,255,255);
myGLCD.setFont(SmallFont);

Serial.println(F("LCD initialised."));

myFiles.load(0, 0, 48, 63,"1image48x63.RAW",3,3);

}

void loop()
{
}

if I use myFiles.load(0, 0, 48, 63,"1image48x63.RAW"); It works but changes color

with this
myFiles.load(0, 0, 48, 63,"1image48x63.RAW",3,3); it is going totally like a rainbow.

The library comes from this, does anyone have the "manual"? GitHub - ghlawrence2000/UTFT_SdRaw: Hi speed image loading from SD/Serial for UTFT. UTFT_tinyFAT replacement.

Many thanks

If anyone can find the manual of UTFT_SdRaw I would kiss him !

Cannot find it anywhere on the web.. just few examples...