Issue uploading a bitmap file onto a 2.8" touchscreen TFT LCD with micro sd card

Hi,

So I've been trying to make a control unit for a project I'm, doing, and this requires me to use a touchscreen LCD shield on my arduino mega. I need to upload the UI to this screen, and have read that the best way to do this is to upload a bitmap file onto an sd card, insert it into the LCD shield and then run an example from the Adafruit_TFTLCD library that I downloaded here. I have run the script with this image loaded into the sd card, following multiple tutorials I have found online. However all I get after following all of the steps is "Loading file image "tiger.bmp" file not found". I have searched up this problem and haven't managed to find a solution that works. Also, in all of the tutorials, the examples from the libraries seems to be different from the examples I'm seeing.

Please help me, thanks in advance :slight_smile:

run an example from the Adafruit_TFTLCD library that I downloaded here.

Does that mean you have the LCD screen from Adafruit (2.8" breakout or Touch Screen Shield)?

Which example did you run? Does it match your hardware? You must have modified it because the examples use another file name

You get that error in two cases: The image file is not on the SD card or the SD card couldn't be read at all. In the second case I would have expected the sketch fail earlier. So please post a screen shot of the content of the SD card you're using.

Hi, thanks for helping.

I'm using the 2.8" adafruit shield.
I'm running the spitftbitmap example from the Adafruit_ILI9341 library. I am currently following Drawing Bitmaps | Adafruit 2.8" TFT Touch Shield v2 - Capacitive or Resistive | Adafruit Learning System this as a guide. I definitely loaded the file onto the sd card correctly and called it the right name. My current guess is the sd card is not supported or something so I will try a new one as soon as I can.

Thanks again.

this is the sd card.

this is the sd card.

The file is not named tiger.bmp!

I'm running the spitftbitmap example from the Adafruit_ILI9341 library.

In the first post you told us you use an example of the Adafruit_TFTLCD library. It's hard to follow you if you change your code without telling us explicitly!

Post the code you currently use and post the error you currently get, so we get updated!

My current guess is the sd card is not supported or something so I will try a new one as soon as I can.

What type of card are you using? The smaller ones all work for me but not the SDHC cards.

Hi! I basically have the same problem as a topic opener evan symonds. I'm having trouble loading bitmaps from a micro SD card to 2.4" Adafruit TFT FeatherWing. I'm using fulltest_featherwing example from ILI9341 library as described in guide on Adafruit web page Drawing Bitmaps. The problem is that images cannot be found on the SD card and the error message says "File not found". Microcontroller I'm using is Sparkfun ESP32 Thing. I'm using 32GB SanDisk Ultra microSDXC UHS-I card. Ofcourse, everything is being programmed in Arduino IDE.

So the main difference between topic opener and me is that I 100% followed the guide. SD card was formatted to FAT32 type, image name loaded to SD card was proper and everything else was working fine before attempting bitmaps. The TFT FeatherWing is actually a board consisting of 3 components (touchscreen display shield with built in microSD card socket, and resistive touchscreen attached to it). I tested every component individually using examples and guides from Adafruit page and other pages. Everything worked fine and SD card test completed with no errors. It successfully created, deleted, renamed and wrote data to textual file (which can be seen on a image below). One SD test actually listed all files on the card and on that list was the bitmap I was trying to upload. So I think there is nothing wrong with my SD card.

Anyways, when uploading an example sketch for drawing bitmaps I noticed some warnings:

C:\Users\Marko\AppData\Local\Temp\arduino_modified_sketch_337946\fulltest_featherwing.ino: In function 'void setup()':

C:\Users\Marko\AppData\Local\Temp\arduino_modified_sketch_337946\fulltest_featherwing.ino:94:29: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

   bmpDraw("purple.bmp", 0, 0);

                             ^

C:\Users\Marko\AppData\Local\Temp\arduino_modified_sketch_337946\fulltest_featherwing.ino: In function 'void bmpDraw(char*, uint8_t, uint16_t)':

C:\Users\Marko\AppData\Local\Temp\arduino_modified_sketch_337946\fulltest_featherwing.ino:148:40: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]

   if ((bmpFile = SD.open(filename)) == NULL) {

                                        ^

Sketch uses 198527 bytes (15%) of program storage space. Maximum is 1310720 bytes.
Global variables use 11732 bytes (3%) of dynamic memory, leaving 283180 bytes for local variables. Maximum is 294912 bytes.
esptool.py v2.1
Connecting........_
Chip is ESP32D0WDQ6 (revision 0)
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...

Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 4681.1 kbit/s)...
Hash of data verified.
Compressed 12304 bytes to 8126...

Writing at 0x00001000... (100 %)
Wrote 12304 bytes (8126 compressed) at 0x00001000 in 0.1 seconds (effective 871.1 kbit/s)...
Hash of data verified.
Compressed 199680 bytes to 112822...

Writing at 0x00010000... (14 %)
Writing at 0x00014000... (28 %)
Writing at 0x00018000... (42 %)
Writing at 0x0001c000... (57 %)
Writing at 0x00020000... (71 %)
Writing at 0x00024000... (85 %)
Writing at 0x00028000... (100 %)
Wrote 199680 bytes (112822 compressed) at 0x00010000 in 2.2 seconds (effective 718.3 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 122...

Writing at 0x00008000... (100 %)
Wrote 3072 bytes (122 compressed) at 0x00008000 in 0.0 seconds (effective 1365.3 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting...

After uploading sketch to board, serial monitor shows this:

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:812
load:0x40078000,len:0
load:0x40078000,len:11392
entry 0x40078a9c
FeatherWing TFT
Touchscreen started
Initializing SD card...OK!

Loading image 'purple.bmp'
File not found

Here are images of SD card setup:


In above image there are two bmp files highlighted because I tried running the sketch with both of them, but without luck. I also highlighted txt files which one of the SD tests created just to prove that the SD card is working.

I hope someone helps as this is a part of important school project. I must also say thank you to pylon who already tried helping the topic opener with this issue. Too bad the later mentioned did not respond back.

SD_card_format.jpg

Many SD card reader in the embedded world cannot read SDXC cards. Have you checked if your card is compatible with your reader? Try using a much smaller card.

My card is 32GB HC not XC (sorry for misguiding you, the link to SanDisk page first shows 400GB XC cards, but if you click on 32GB, you will see they are not XC). As for the compatibility, unfortunately I could not find that info anywhere on the web. It seems strange though, that using some SD libraries I was able to write to my SD card (created, read from, renamed and deleted .txt file), but when it comes to loading bitmaps, the error shows up. Maybe it is because of bad library?

When I get a hold of smaller 2 or 4GB SD (not HC) card and try it out, I'll post back results.