3.5" TFT LCD Question

I am not the author of UTFT.

No, you don't need to uninstall anything.

Just find the "UTFT.cpp" file in your libraries directory. My one is here:

C:\Users\David Prentice\Documents\Arduino\libraries\UTFT\UTFT.cpp

Your user directory is probably called "dudester" instead of "David Prentice"

Edit it with Notepad or other text editor. Remember to save it back after you have changed the dtm[] line. Then re-build your test sketch in Arduino IDE in the usual way.

David.

If you use the Arduino IDE, you can run different versions together,
you don’t have to remove the lastest version.

But I should try David’s solution first. I’s possible that you find dtm in different places in your cpp file,
I think it’s in this part ?

UTFT::UTFT(byte model, int RS, int WR, int CS, int RST, int SER)

:David
Why do you think they deliver a library for the board that would never work ?

Because Ebay vendors don't know and don't care.

They provide photos and descriptions that do not match the items they sell. I would guess that 9 out of 10 dissatisfied customers do not ask for their money back.

If they did, vendors would be "better".

Mind you, trying to get a Forum member to compare website photos with the item in their hand is (sometimes) like getting blood out of a stone. Or even post a link to the sale in the first place.

David.

OK, I edited the dtm[] line but still get the same issue, display flickers as if its trying to do something but nothing ever displays. Would you be able to send me your edited .cpp file, perhaps I got that wrong.

Wait for a few hours. There are other punters with this actual shield. With luck, one or two will try the mod that I suggested. And report back.

I did not write UTFT. I do not have your hardware. I am reluctant to go hacking someone else's library without being able to test for myself.

When I hear whether the mod works, either the fellow member or I could help you. Meanwhile, please be patient.

If and when there is a solution, you could advise the Ebay vendor. 1. that they sold you an item that does not match their photos 2. that their software does not work. 3. you could help them to provide working software.

David.

Hi,

Thanks David, will wait...

Any update on this?

Yes, Harry tried my "quick UTFT fix" and it did not work. However his display does work with (a new version of) my library.

Hi,

After a lot of experimenting I have the demo code working with the original library and an old version IDE using a different mega pcb, I think mine was susspect.
(Tried your library again on new mega and that still just gives a blank screen)

However I now have noticed two wierd issues, my code is below…

I do have another question regarding the line
UTFT myGLCD(ITDB32WC,38,39,40,41);
I tried changing this to ILI9481 but this gives errors…?
(Does not give errors on your modified library but that displays nothing)

1…
The drawLine test draws a verticle line and should draw a horizontal line joined at the end, but it does not. Its offset…?
See screenshot-1

2…
The fillRect test draws two boxes which should be 1 pxel apart but they display about 20 pixels apart…?
See screenshot-2

#include <UTFT.h>
extern uint8_t SmallFont;
UTFT myGLCD(ITDB32WC,38,39,40,41);

void setup()
{
randomSeed(analogRead(0));
// Setup the LCD
myGLCD.InitLCD();
}

void loop()
{

// Draw Lines
myGLCD.clrScr();
myGLCD.drawLine(200, 100, 200, 250);
myGLCD.drawLine(200, 200, 300, 200);
delay(10000);

// Draw some filled rectangles

myGLCD.clrScr();
myGLCD.setColor(69,57,94);
myGLCD.fillRect(200, 100, 450, 140);
myGLCD.fillRect(200, 141, 450,181);

delay(10000);

}

screenshot-1.jpg

screenshot-2.jpg

Please give specific information i.e.

  1. what original library? give version number or a link
  2. what old IDE? give version number
  3. what do you mean by “your library”?
  4. life is much simpler if you say what the magic model number is.

I had to look up UTFT.h to see:

#define ITDB32WC		1	// ILI9327  (16bit)

Surely your display is not 400x240. 400x240 is la different shape to 480x320.

If you get “some” display with ITDB32WC, it implies that you have a 16-bit interface.
Your earlier photos implied 8-bit interface.

There is nothing very complicated about UTFT. i.e. choose suitable controller type and interface type.

If you choose the “wrong” controller, the initialisation commands might upset your device. e.g. what registers set the Gamma Curve on one chip might actually set the Power registers on your chip. Some values can do damage.

Regarding your screenshots. If you give accurate information, you can have a sensible answer.

David.

david_prentice:
Please give specific information i.e.

  1. what original library? give version number or a link
  2. what old IDE? give version number
  3. what do you mean by “your library”?
  4. life is much simpler if you say what the magic model number is.

I had to look up UTFT.h to see:

#define ITDB32WC		1	// ILI9327  (16bit)

See below…

1 - http://osoyoo.com/driver/3.5LCD_ili9481.rar
2 - 1.0.3
3 - https://github.com/dgolda/UTFT
4 - ILI9481

I just dont understand why, when I use the library in point 3 and assign the correct myGLCD i get a blank screen. Photo’s ARE correct.

Ah-ha. The http://osoyoo.com/driver/3.5LCD_ili9481.rar has a hacked UTFT that only accepts HX8347A, ILI9327, SSD1289. It looks as if it was a very early UTFT that has been hacked.

It then forces inappropriate geometry sizes and interface. e.g. 480x320 with 8-bit interface for "ILI9327".

Note that everything will fail with a genuine UTFT library.

Looking at the https://github.com/dgolda/UTFT hacked library, he has added a model called ILI9327_8 that is 400x240 w 8-bit interface. This is also a bit old. i.e. he hacked a v2.7.8 UTFT (current UTFT is v2.8.1)

I doubt if you need to use an obsolete IDE. It will give you serious problems with all your other Arduino projects. Most older libraries and sketches will only need an extra const when you have a PROGMEM item. It is much easier to fix the old sketch than to change IDEs.

David.

OK, glad its making sense to you...

I just tried defining the ILI9327 in myGLCD with the old IDE too, demo code works but same two issues happen.

Thanks for you help, so where to from here? Am I better to get a different display?

Yes, it all makes sense to me. However you must be honest. i.e. which UTFT are you actually using?

And what are the "same issues"?

It makes all the difference when you post links or copy-paste a few of the error messages.

David.

The draw line and fillrect offset issue in my earlier post.

david_prentice: Yes, it all makes sense to me. However you must be honest. i.e. which UTFT are you actually using?

And what are the "same issues"?

It makes all the difference when you post links or copy-paste a few of the error messages.

David.

Seriously, please answer the questions. I have spent time on your behalf. If you are not prepared to answer, I will give up.

David.

No need to go back over that, I was just recapping. You answered the question already.

But not clear on how to go forwards from here...