2.4 inch TFT touch LCD Screen Module For Arduino UNO R3 SD low price jocks

yes. the problem with 1.5 is they've changed some compilation option (or compiler version, I don't know) wich now causes the error above, and stops compiling. So as the error messages explain, the font[] variable must be declared as "cosnt", so the workaround is quite simple : go to the library folder, open the file named in the error message, and change the font declaration to meet the requirement.

Hello.
I purchased 5 of these displays a few days ago ( labeled www.mcufriend.com) of which 1x display works perfectly with the driver ts7783 fond in this thread, but 4 x displays just shows garbled pixels ( which i think is what McAndrew got.. the differenc with my LCD's is that the serial output says " LCD test! Unknown driver, ID=0.."

Is there a way to manually locate ins software or physically on the hardware) which driver the LCD is using or is the driver the actual LCD?

Here's what my TFT looks like..

Thanks for any info

I just got a TFT that didn't work "out of the box" for me either.

Here is something you can try:

  • Copy the AdaFruit driver into a new directory
  • Rename the .cpp and .h files to match the directory name. This creates a new library
  • Edit the .cpp
  • Edit the .cpp file and look for the line uint16_t Adafruit_TFTLCD::readID(void) {,[/li]
  • Add these right after that line:[/list]
//return 0x9325;
//return 0x9328;
//return 0x9341;
//return 0x8357;
//return 0x7575;

[/li]

  • Starting at the BOTTOM, uncomment the lines one by one and test, see if any of them work.
  • If none of them work, re-comment all the lines then edit the .h file and comment (or uncomment) the line //#define USE_ADAFRUIT_SHIELD_PINOUT 1
  • Try all the above return options again, remember to start at the BOTTOM

Took a while, but it worked for me.

As it turned out, even though my board was a shield, I had to configure the code to work as breakout.

After that it I had to experiment a bit more with the pins to get the touch screen working.

If it doesn't detect the driver don't fear. It may still be a 778x, but it is not being initialized, because the software has no idea what it is.

void setup()
{
  Serial.begin(9600);

  tft.reset();

  uint16_t identifier = tft.readID();

  
    Serial.print(F("Found LCD driver chip ID: "));
    Serial.println(identifier, HEX);
    
  tft.begin(identifier);

As you see the software reads the initializer and throws it on the init.

If there is no ID being read replace the above with:

void setup()
{
  Serial.begin(9600);

  tft.reset();
  tft.begin(0x9325);

The 0x9325 is a guess. Thats the only thing I have in my library, which you are likelly to be using. If not try one at the time as mentioned by jstarcher:

0x9325;
0x9328;
0x9341;
0x8357;
0x7575;

There's no need to edit the .cpp. All is done within the sketch.

Thank you both
Ah.. i tried so many different software packages i found and got sent to me a couple of different one's from the seller but i see now that the Adafruit one has all these other options.. and the 0X9341 saved the day for those that didn't work.. This is platinum quality help guys!

..and i think this should be excellent info in a sticky.. saves a ton of time and a bucket of headache figuring out.

Karma up to both of you!

Anybody has a working code for 2.8" arduino tft shield from www.mcufriend.com?

Pls help.

Anyone got one of those 2.4" ST7783 displays working with Arduino Due?
Using the libraries from previous post (with Mega pinout since they are the same) gives only pages of errors...

SWTFT+Adafruit GFX

Arduino:1.5.8 (Windows 7), Scheda:"Arduino Due (Programming Port)"

C:\Users\Stez\Documents\Arduino\libraries\SWTFT\mega_24_shield.h:89:18: note: in expansion of macro 'write8inline'
   #define write8 write8inline
                  ^
C:\Users\Stez\Documents\Arduino\libraries\SWTFT\SWTFT.cpp:621:2: note: in expansion of macro 'write8'
  write8(lb);
  ^
In file included from C:\Users\Stez\Documents\Arduino\libraries\SWTFT\SWTFT.cpp:15:0:
C:\Users\Stez\Documents\Arduino\libraries\SWTFT\mega_24_shield.h:63:5: error: 'PORTE' was not declared in this scope
     PORTE = (PORTE & B11001111) | ((d << 2) & B00110000); \
     ^
C:\Users\Stez\Documents\Arduino\libraries\SWTFT\mega_24_shield.h:89:18: note: in expansion of macro 'write8inline'
   #define write8 write8inline
                  ^
C:\Users\Stez\Documents\Arduino\libraries\SWTFT\SWTFT.cpp:622:2: note: in expansion of macro 'write8'
  write8(lb);
  ^
C:\Users\Stez\Documents\Arduino\libraries\SWTFT\mega_24_shield.h:65:2: error: 'PORTG' was not declared in this scope
  PORTG = (PORTG & B11011111) | ((d << 1) & B00100000); \
  ^
C:\Users\Stez\Documents\Arduino\libraries\SWTFT\mega_24_shield.h:89:18: note: in expansion of macro 'write8inline'
   #define write8 write8inline
                  ^
C:\Users\Stez\Documents\Arduino\libraries\SWTFT\SWTFT.cpp:622:2: note: in expansion of macro 'write8'
  write8(lb);
  ^
C:\Users\Stez\Documents\Arduino\libraries\SWTFT\mega_24_shield.h:66:2: error: 'PORTH' was not declared in this scope
  PORTH = (PORTH & B11100111) | ((d >> 3) & B00011000); \

And so on, trimmed due to max lenght exceeded..

Hello.

Also I purchased one 2.4 inch TFT touch screen supporting ( For UNO R3 ) labeled www.mcufriend.com and I try to put in function, but no good results just shows garbled pixels.
Thanks in advence for any info.

@stez90: It looks like the sketch is trying to declare something that the libraries can't resolve.... i tried to convert a similar project from the MEGA to the DUE and ran into sh#tload of errors because of incompatible libraries and different voltages... so i took another path.

Which sketch are you running?

@Aguther: All information you need to know should be found is in this thread.. the ts7787 driver worked for one of my TFT's but the other 4 needed a tweak in the ADAfruit.cpp setting the driver manually to x9341 to work properly as they all had the "unknown driver" error.

If it doesn't work with the x9341 you just have to try the next one and so on until you find which it is.

It also may work with the advice from casemod but i only tried jstarchers so i guess you'll have to find this out by yourself.

@rmohan10: The ADAfruit one's should be able to run the 2.8".. look at their pages to find the latest files.
Good luck

Just for the sake of trying to help and knowing what headache i had trying to figure this out, here's some icecream for you:

Download the latest ADAfruit libraries and add them to where your userlibrary is located (mine is at: C:\Users\QUAD ONE\Documents\Arduino\libraries).

Load up the GraphicsTest.ino that comes with this library

In the GraphicsTest.ino, change the line:

uint16_t identifier = tft.readID();

to

uint16_t identifier = 0x9341;

This way you "hardcode" what driver should be used as it can't resolve this on it's own

If this doesn't work you can try to substitute with the other possibie types:

0x9325;
0x9328;
0x9341;
0x8357;
0x7575;

Good luck (again)

hello,

I have not succeeded yet, but I hope to find help to find the working solution and this garbled pixels to disappear and the shield is operate.

I try all this types:
0x9325;
0x9328;
0x9341;
0x8357;
0x7575;

without succes.

Hello. I saw that a few people had solved their issues with their touch screens. I purchased one of these a few days ago and its still on the way. But as I was looking up how to get it to work I came across this post. Did anyone figure out this specific model? Any help would be greatly appreciated as I am still a newby.

aguther:
hello,

I have not succeeded yet, but I hope to find help to find the working solution and this garbled pixels to disappear and the shield is operate.

I try all this types:
0x9325;
0x9328;
0x9341;
0x8357;
0x7575;

without succes.

Have you installed the latest Ada fruit libraries?

Also note that if you have more than 1 library of the same type Arduino might choose what it finds and therefor the problem might persist.

Try to remove or delete any older Adafruit libraries and install them again. Also check that you don't have put libraries both in the Userfolder and the Arduinofolder..( the folder where Arduino is installed) then it won't work as Arduino picks whatever it finds..

The descriptions in this thread should with 99% certainty work for you if you have all libraries installed correctly.

Good luck

hunter2379:
Hello. I saw that a few people had solved their issues with their touch screens. I purchased one of these a few days ago and its still on the way. But as I was looking up how to get it to work I came across this post. Did anyone figure out this specific model? Any help would be greatly appreciated as I am still a newby.

The Adafruit library is said to work up to the 2,8" as well
It seems MCUfriend uses random drivers for their different LCD's and if you can't read it on the cirquits directly it could be a little trial and error to find out, but read through posts here ( in this thread) i'm pretty sure you'll get it running in notime.
Post back here otherwise and i'm sure somebody willl be able to help out.

Cheers

stez90:
Anyone got one of those 2.4" ST7783 displays working with Arduino Due?
Using the libraries from previous post (with Mega pinout since they are the same) gives only pages of errors...

SWTFT+Adafruit GFX

Yep i got it working with the code from smoke and wirers.. the SWIFT library..
http://www.smokeandwires.co.nz/blog/a-2-4-tft-touchscreen-shield-for-arduino/

Even moved it to a breakout and did a Osccilliscope.

However the touch is shit, when you touch in the drawing example, everything is mirrored
both horizontal and vertical, so pushing top right actually draws button left..

Well i'm not using the touch anyway.

Another problem, this is ONLY working on Arduino UNO boards,
I tryed

  • Leonardo, nano, mini pro and mega
    neither works

Only works on both Original Uno's and a few china Uno's ive testet on.

Thanks but it doesn't look like an Arduino Due (32bit ARM microprocessor).. I got it working on Uno and Mega, but not on Due..

aguther:
Hello.

Also I purchased one 2.4 inch TFT touch screen supporting ( For UNO R3 ) labeled www.mcufriend.com and I try to put in function, but no good results just shows garbled pixels.
Thanks in advence for any info.

Friends,

I also have the same issue as aguther and i tried all your advices so far but non of them worked. From www.mcufriend.com site i found out that the control IC is ST7781 and from below address i found the specific library for the IC.
GitHub - yamsam/TFTLCD_ST7781: Arduino TFTLCD library for ST7781
yet i get this garbled pixals.

If someone can help me it would be great.
I spent this whole week trying to figure out this ?

SujanW:
Friends,

I also have the same issue as aguther and i tried all your advices so far but non of them worked. From www.mcufriend.com site i found out that the control IC is ST7781 and from below address i found the specific library for the IC.
GitHub - yamsam/TFTLCD_ST7781: Arduino TFTLCD library for ST7781
yet i get this garbled pixals.

If someone can help me it would be great.
I spent this whole week trying to figure out this ?

Download the ST7781 found earlier in this thread.. it worked for one of my LCD's.. i'd suggest that you also open the serial monitor when running the code to see that it actually find the driver and that it - IS - the ST7781

It may well be that it isn't that driver even if it should.. the garbled pixels makes this somewhat obvious it's still a problem with the driver, or that Arduino couldn't make this out by running the code. I have tried so many drivers and libraries out there but what did the trick was to install the latest ADAfruit libraries and - manually - set the driver in the "Graphicstest.ino" sketch that comes with the libraries.

If you load and run the sketch and open the Serial monitor window and see what it gives for an answer when running the code.. If the serial monitor says " Unknown driver" when running the code.. then it's not ST7781...or it couldn't discern it.. in this case try to set this manually and you may as well have a winner

Also: If it is the ST7781, and you have set it manually, but still doesn't work, make sure you have the latest libraries and no doubles of any library. It might be you installed a new library but Arduino still picks the old one.. No doubles - No troubles

Otherwise: Set up the sketch as you normally would before running it and post it here. It's way easier to help by seeing how the code is set up.. maybe there's something you'ver overlooked by trying over and over..

Cheers

Lundin Thanks a lot for the advice mate.

I may be getting somewhere but I don't know if it is the right direction.
As you said I cleaned the library and kept only Adafruit libraries and ran Graphicstest.ino.
Bingo it says "unknown lcd driver chip c0c"
however going further with your advice I hardcoded all 5 types of drivers but yet no success.

It makes me wonder could there be another driver IC which we may have missed.
your thoughts are greatly appreciated.

Thanks in advance.

Can you perhaps put up the little snippet of code to show how you made the changes? It seems fairly strange that none of them worked..
...but ofcourse.. mcufriend may have gone with a totally different driver.. nothing suprises me anymore regarding imported stuff..it's like russian roulette sometimes :slight_smile:

It was the ST7783 i meant, not the ST7781