Hey everybody,
My TFT works fine for everything excepted showing pictures from SDcard.
I tried 2 libraries, TinyFat which does not work below 2 Go so that sucks.
And also UTFT_SdRaw which is really mysterious to me ;
- it does not display in the right color
- it change the background color of the picture to white
- I can not multiply the size of the picture
Here is my demo-test-code ;
#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",1,0);
myFiles.load(100, 100, 60, 51,"Thermometre.RAW",1,1);
myFiles.load(200, 200, 30, 30, "Clock.raw",4,0); //myFiles.load(x coordinate, y coordinate, image-x-size, image-y-size, fname[, buffer-size-multiplier, invert colour]);}
void loop()
{
}
As you can see in attachment (original picture file vs result on display), the original color is not the same at all, and the background of all pictures should be black.
Impossible to multiply the size
And even when I set invert colour to 0 or 1, it's still wrong ( excepted for the thermometer and even the picture is not that clear).
I've been working on this problem for a while, and it is the last step for my project, really frustrating.
I start to get fed up, close to buy a 2 Go SD and using tiny but it would a really stupid constrain.
Any help would be appreciated !
Thanks guys
![]()
![]()

