TFT LCD Display File Not Found Error

While trying to use the Demo_Landscape example from the UTFT_tinyFAT library to display some images, I kept getting "File not found..." on my display despite the fact that I have correctly formatted the SD card, properly plugged it into the back of the display, and made sure the files were named correctly, no spelling mistakes and caps sensitive. I didn't alter the code aside from changing the names of the .RAW files, what's the problem???

I am using an Arduino Mega 2560R3 from Elegoo and I am using a HiLetgo TFT LCD ILI9486 Display https://www.amazon.com/HiLetgo-Display-ILI9481-480X320-Mega2560/dp/B073R7Q8FF?tag=coa_us_g-20
I am using .RAW files because that is what was suggested by the demo, unless I am severely mistaken.

Welcome to the forum

Please post the problem sketch here, using code tags when you do

Which Arduino board and exactly which display (link ?) are you using ?

What is the format our your image filenames ? Please give some examples

#include <tinyFAT.h>
#include <UTFT.h>
#include <UTFT_tinyFAT.h>

// Declare which fonts we will be using
extern uint8_t SmallFont[];

UTFT         myGLCD(ILI9486, 38, 39, 40, 41);   // Remember to change the model parameter to suit your display module!
UTFT_tinyFAT myFiles(&myGLCD);

// List of filenames for pictures to display. 
char* files320[]={"BYRDWIGGLE.RAW", "BYRD.RAW", "BYRDSIT.RAW", "PIC405.RAW", "PIC305.RAW", "PIC306.RAW", "PIC307.RAW", "PIC308.RAW", "PIC309.RAW", "PIC310.RAW"}; // 320x240
char* files400[]={"PIC1.RAW", "", "", "", "", "", "", "", "", ""}; // 400x240
char* files220[]={"PIC2.RAW", "", "", "", "", "", "", "", "", ""}; // 220x176
char* files480[]={"PIC3.RAW", "BYRD.RAW", "", "", "", "", "", "", "", ""}; // 480x272
char* files800[]={"PIC4.RAW", "", "", "", "", "", "", "", "", ""}; // 800x480
char* files[10];

int picsize_x, picsize_y;
boolean display_rendertime=false;  // Set this to true if you want the rendertime to be displayed after a picture is loaded
boolean display_filename=true;  // Set this to false to disable showing of filename

word res;
long sm, em;

void setup()
{
  myGLCD.InitLCD();
  myGLCD.clrScr();
  file.initFAT();
  myGLCD.setColor(255,255,255);
  myGLCD.setFont(SmallFont);
  picsize_x=myGLCD.getDisplayXSize();
  picsize_y=myGLCD.getDisplayYSize();
  switch (picsize_x)
  {
    case 220:
      for (int z=0; z<sizeof(files220)/sizeof(*files220);z++)
        files[z] = files220[z];
      break;
    case 320:
      for (int z=0; z<sizeof(files320)/sizeof(*files320);z++)
        files[z] = files320[z];
      break;
    case 400:
      for (int z=0; z<sizeof(files400)/sizeof(*files400);z++)
        files[z] = files400[z];
      break;
    case 480:
      for (int z=0; z<sizeof(files480)/sizeof(*files480);z++)
        files[z] = files480[z];
      break;
    case 800:
      for (int z=0; z<sizeof(files800)/sizeof(*files800);z++)
        files[z] = files800[z];
      break;
  }
}

void loop()
{
  
  for (int i=0; i<(sizeof(files)/sizeof(*files)); i++)
  {
    if (files[i]!="")
    {
      sm=millis();
      res=myFiles.loadBitmap(0, 0, picsize_x, picsize_y, files[i]);
      em=millis();
      if (res!=0)
      {
        if (res==0x10)
        {
          myGLCD.print("File not found...", 0, 0);
          myGLCD.print(files[i], 0, 14);
        }
        else
        {
          myGLCD.print("ERROR: ", 0, 0);
          myGLCD.printNumI(res, 56, 0);
        }
        delay(3000);
        myGLCD.clrScr();
      }
      else
      {
        if (display_rendertime==true)
        {
          myGLCD.print("Rendertime (secs):", 0, 0);
          myGLCD.printNumF(float((em-sm)/1000.0), 2, 160,0);
        }
        if (display_filename==true)
        {
          myGLCD.print(files[i], CENTER, myGLCD.getDisplayYSize()-12);
        }
        delay(3000);
      }
    }
  }
}

I am using an Arduino Mega 2560R3 from Elegoo and I am using a HiLetgo TFT LCD ILI9486 Display https://www.amazon.com/HiLetgo-Display-ILI9481-480X320-Mega2560/dp/B073R7Q8FF?tag=coa_us_g-20
I am using .RAW files because that is what was suggested by the demo, unless I am severely mistaken.

Your MEGA2560 board should be fine.
Your Mega2560 display Shield should be fine.

Install the appropriate third party libraries. You are on your own. None of them are supported by the IDE Library Manager.

Copy the RAW Image files to your SD card e.g. from
C:\Users\ ... \Documents\Arduino\libraries\UTFT_tinyFAT\Image-files

Run all the UTFT_tinyFAT library examples.
Replace the example constructor. Your constructor is fine.

Report back with any problems.

It is unwise to start with your own custom sketch. Verify the library and hardware first (i.e. with the library example)

RAW files do not contain any information about their geometry.
If you do not know the geometry of your custom images, put them into a ZIP file. Attach the ZIP.
I do not want to see a ZIP with the library example images. I can see them from the library installation.

David.

I have installed the third party libraries and run the program using only the default code and RAW images copied onto the SD card, which results in the same "file not found" error repeating on the display as before.
The only issue i see is that tinyFAT.h does not change to an orange color like UTFT.h and UTFT_tinyFAT.h, despite the fact that the tinyFAT library is installed same as the other two.

when i go to include tinyFAT.h it inserts these into the sketch

#include <HW_AVR.h>
#include <HW_AVR_defines.h>
#include <mmc.h>
#include <SD_defines.h>
#include <tinyFAT.h>

i checked the tinyFAT file and all these appear to be in there, i do not understand why it is displaying them in plain black text as if it does not recognize them.

None of those libraries are approved by the Library Manager.
How do we know where you got them from ?

Post links to the relevant websites.
If you have a problem with a library file quote the actual filename.

If you have a problem with SD card quote the Make, size and model number.
"SD.h" copes with SD sizes from 128MB to 32GB

David.

http://rinkydinkelectronics.com/library.php?id=37
this is where i obtained the tinyFAT library, and the SD card appears to be working just fine, i have no issues viewing the contents on my computer.

Thanks for the link. It looks as if all three non-supported libraries are available from there.

Note that the tinyFAT.h page says:

The library supports FAT16 formatted SD cards up to 2GB in size. 4GB FAT16 formatted SD cards does not work. Long filenames are not supported. Keep your filenames compliant with the old 8.3 standard.

David.

I am aware of these limitations, and have accounted for them. My SD card is a mere 1GB in size, and has been formatted to FAT16 twice. I have also kept the file names relatively short, and I also have UTFT_tinyFAT and UTFT libraries installed, yet the tinyFAT.h in the script remains in black normal text, which I believe may be the issue, because it is for some reason not recognizing it like the other libraries mentioned.

Are you getting an error message from the sketch or an error message when you try to upload the sketch ?

If the latter then please copy the full error message using the "Copy error message" button in the IDE and post it here in code tags

I am running Demo_Landscape.ino on a 320x240 SSD1289 Shield using a generic 2GB microSD.

When I tried a 128MB microSD I got "Filename not found errors". (I had copied the files to the SD card this morning)

Ok, I am using a "historic" set of libraries. Mr Karlsen does not believe in conforming to library standards. (UTFT_VERSION = 283)

Using library tinyFAT in folder: C:\Users\David Prentice\Documents\Arduino\libraries\tinyFAT (legacy)
Using library UTFT in folder: C:\Users\David Prentice\Documents\Arduino\libraries\UTFT (legacy)
Using library UTFT_tinyFAT in folder: C:\Users\David Prentice\Documents\Arduino\libraries\UTFT_tinyFAT (legacy)

If you use "approved" libraries the build reports version numbers.
Which is very helpful when readers attempt to replicate your build.

David.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.