Go Down

Topic: (SOLVED) Problem with Waveshare 2.8'' TFT with Adafruit GFX Library (Read 234 times) previous topic - next topic

denkmic

Hello,

I am searching near a week now with no luck so... encouraged by @david_prentice decided to give it a try here.

I have this 2.8 inch waveshare TFT (https://www.waveshare.com/wiki/2.8inch_TFT_Touch_Shield), which I found very annoying.

I do not know how to get it working with Arduino Uno and the Adafruit gfx library. Need to make a custom touch menu for my car (with friendly bmp images). The waveshare... so called library seems to be useless at this point.


Can anybody help me?  :smiley-confuse:

denkmic

Also: the mock_ili9341 sketch, using SPI and pins set to:

Code: [Select]
Adafruit_ILI9341 tft = Adafruit_ILI9341(10, 7);

Seems to work (i think so because of the com port monitor output, check it below) but the display is... black. The port monitor output:

Code: [Select]
Self Diagnostic: 0x87
Benchmark                Time (microseconds)
Screen fill              1352096
Text                     168556
Lines                    1474304
Horiz/Vert Lines         115560
Rectangles (outline)     76752
Rectangles (filled)      2806676
Circles (filled)         477668
Circles (outline)        625444
Triangles (outline)      324240
Triangles (filled)       1267912
Rounded rects (outline)  239324
Rounded rects (filled)   2840208
Done!

david_prentice

Your display has a write-only HX8347D.

Install HX8347D_kbv library from GitHub

It is not a "public" library but should be ok for you.
Ask if you have any problems.

David.

denkmic

Seems like you just save my life!

All examples are working nicely. I have only one problem. When trying to display a bmp file, it says: "bad BMP ID".

I am using the default files from waveshare at this point. They are 24-bit bitmaps. Should I use other settings?

david_prentice

What BMP are you trying to display?
If you put your SD card into the PC and click on the BMP,  does it display on the PC?

There are some sample BMP files in my MCUFRIEND_kbv GitHub repository e.g. here

But you will find other sample BMP files in several libraries.

If you have a problem with your specific BMPs,  put them into a ZIP file and attach to your message.
The Forum accepts ZIP.  It does not accept the .BMP extension.

David.

denkmic

Thank you for your time.

I tried, but none of them works.

Yes, my bitmap is working on a PC, I've edited it in Photoshop. For instance, I would like to display attached bmp as background and on top on it should go few buttons.

david_prentice

#6
Aug 18, 2019, 09:42 am Last Edit: Aug 18, 2019, 09:52 am by david_prentice
Oops.   I suspect you are using Uno with only 2048 bytes of SRAM
The SD.h library is very tight for SRAM

Please edit the example sketch (near line #100).   Change PALETTEDEPTH from 8 to 4

All 24-bit BMP should display.
All 16-bit BMP should display.
8-bit BMP should NOT display.
All 4-bit BMP should display.
All 1-bit BMP should display.

David.

Edit.  Extra Oops.  Colours are not correct on 4-bit and 1-bit BMP
I will update GitHub later today.

denkmic


Go Up