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

hi dear friends
I want to use from this module for arduino UNO :
read values of 3 sensors,but 5 of analoge pins connect to TOUCh LCD :frowning:
can you help me for doing this work ?

I believe that is very difficult.
It is more simple to use an SPI TFT module or, if possible, to use I2C sensors. Or get a Mega instead of a UNO taking in account that some libraries don't work with Mega.
Unfortunately these parallel TFT modules use too much pins.

zoomx:
I believe that is very difficult.
It is more simple to use an SPI TFT module or, if possible, to use I2C sensors. Or get a Mega instead of a UNO taking in account that some libraries don't work with Mega.
Unfortunately these parallel TFT modules use too much pins.

thank you very much :slight_smile:

minimanimo:
Hi,i've the same problem.
I have 2.4'' TFT display, MCUFRIEND (it had ILI9341 LCD driver) on Arduino Uno.
I've used this library,beacuse i have problem with the white screen,this: Library and videotutorial

I have tftpaint inverted touch-screen coordinates,but the change had no effect.
Can you help me?

Yes took me a while as well, first here the specs to my display:

As another user said, you can make the following changes
(I have also attached the code that runs on mine)

From:
//#define YP A1  // must be an analog pin, use "An" notation!
//#define XM A2  // must be an analog pin, use "An" notation!
//#define YM 7   // can be a digital pin
//#define XP 6   // can be a digital pin

To:
#define YP A2  // must be an analog pin, use "An" notation!
#define XM A1  // must be an analog pin, use "An" notation!
#define YM 6   // can be a digital pin
#define XP 7   // can be a digital pin

Second make this next change:

From:
p.x = map(p.x, TS_MINX, TS_MAXX, tft.width(), 0);
p.y = map(p.y, TS_MINY, TS_MAXY, tft.height()-BOXSIZE*2, 0);

To:
p.x = map(p.x, TS_MAXX, TS_MINX, 0, tft.width() );
p.y = map(p.y, TS_MAXY, TS_MINY, 0, tft.height() );

paint-example.ino (7.16 KB)

For this display you may use the Adafruit_TFTLCD and the touchscreen librarys.

In the setup area add a line uint16_t identifier = 0x9341; just after tft.reset(); (tftpaint.ino)
ILI9341 is the TFT controler, Adafruit has now a Adafruit ILI9341 library who's giving a lot of errors while compiling.

If you want to use I2C you have to wire the reset-pin of the screen to the reset-pin of the arduino en change #define LCD_RESET to A6 (not connected on the UNO)

Your example should work now.

Succes, Robert.

Hello pals,

Please, I need your help: I have also bought that tft lcd with st7783... After some struggle, I managed to make it works... However I found it does not work properly: Everytime I cut the energy I had to run a sketch to wake up the chip, since after restablishing the energy the shield does nothing but shows a white screen... To wake up the chip (st7783) I set the CS to low for some seconds, then make a void.begin(), then repeat every 2 o 3 seconds a fill screen command... while doing this stuff, the shield does not do anything, but after a while by reloading the previously working sketch it worked again...

Now, PLEASE I need your help to turn off the backlight leds, I don't find information to do this in this particular shield...

Thanks in advance!

There is no way that you can turn off the backlight. Just do a tft.fillScreen(BLACK) if you want a dark screen.

The ST7781 should work perfectly. Which library are you using?

The only "spare" pin is A5. If you wanted to cut tracks on your shield, you could switch a transistor or MOSFET to control the backlight.

David.

Thanks David!

Adafruit_GFX and SWTFT... the sketch firts ask for the number of the chip and it returns 7783, not 7781. The problem is as I explained before.

Since the manufacture seems to be very poor I was hoping to find a safer way to control the backlight leds without having to open the tftlcd...

Regards,

SCG

I presume that SWTFT library handles the ST7781 controller ok. (ST7781 is the part number. It returns an ID of 0x7783)

Yes, the mcufriend UNO shields are very cheap. I would not describe the manufacture as "poor". But you may have one with screen or Touch that is not perfectly straight.

As I said, the Shield uses most of the UNO's header pins. The backlight is always lit. You would need to separate the TFT from the pcb. Then alter the circuitry by adding a transistor to switch the backlight. Then re-assemble the display.

Why do you want to turn the backlight off? These displays take a lot of current. They are not suitable for battery operation.

David.

Thanks again David!

I am planning to use this for a device that will work with a battery, so I was looking to reduce energy consumption... I have already notice that the tftdisplay get noticeable hot after some time of operation, so I guessed that turning off the backlights will reduce its consumption.

If I get it clear, you are telling me that even if I get control over the backlight leds the energy consumption would be that high so the application would no be ok to work with a battery, am I right? If so, what would be your recommendation of use instead of this kind of display?

Thanks in advance,

scgECU

Hack your pcb. Switch the backlight via a transistor. Turn the backlight off and send your Arduino to sleep when not busy.

Seriously, batteries are not going to last very long. Even with you going to sleep. I would use a series resistor to reduce backlight current too.

David.

hi,
Is anybody help, how to update text without blinking display with fillscreen?
In my simple example "IN:" must be static and updating only 'i' value. Thanx.

#include <Adafruit_GFX.h>    // Core graphics library
#include <SWTFT.h> // Hardware-specific library
#define BLACK   0x0000
SWTFT tft;
int i=0;
void setup(void) {
 tft.reset();  tft.begin(tft.readID());
 tft.fillScreen(BLACK);}
void loop()
{i=i+1;
tft.fillScreen(BLACK); tft.setCursor(0, 0); tft.setTextSize(3);
tft.print("IN: ");tft.print(i); tft.println();
delay(1000);}

Go on. Think about it. The easiest way is to draw a flowchart on paper with a pencil.

Then re-arrange the flow to produce the result that you would like.

Hint. Just erase the small area where you write the new number.
Alternatively, setTextColor() with both the foreground and background colour.

David.

david_prentice:
Go on. Think about it. The easiest way is to draw a flowchart on paper with a pencil.
Then re-arrange the flow to produce the result that you would like.
Hint. Just erase the small area where you write the new number.
Alternatively, setTextColor() with both the foreground and background colour.
David.

thanx David for direction, but i don't understand how 'erase small area'?
i found WO with fillrect, but it looks like stone age solution :frowning: but result suitable
I think must be more intelligent solution, without gaming with coordinate and paint eraser ...

#include <Adafruit_GFX.h>    // Core graphics library
#include <SWTFT.h> // Hardware-specific library
#define BLACK   0x0000
SWTFT tft;
int i=0;
void setup(void) {
 tft.reset();  tft.begin(tft.readID());
 tft.fillScreen(BLACK);}
void loop()
{i=i+1; 
tft.setCursor(0, 30); tft.fillRect(50,30,150,30,BLACK);tft.setTextSize(3); 
tft.print("IN: ");tft.print(i); tft.println();
delay(1000);}

studentas:
thanx David for direction, but i don't understand how 'erase small area'?
i found WO with fillrect, but it looks like stone age solution :frowning: but result suitable
I think must be more intelligent solution, without gaming with coordinate and paint eraser ...

I find more intelligent solution, but still not enough for perfect :slight_smile:

void loop()
{i=i+1; 
tft.setCursor(0,30); tft.setTextSize(3); tft.setTextColor(WHITE); tft.print("IN: ");
tft.setCursor(50,30);tft.setTextColor(BLACK); tft.print(old); 
tft.setCursor(50,30);tft.setTextColor(WHITE); tft.print(i); tft.println();
old=i;
delay(1000);}

The first step is to learn how to format code neatly. Then place it within CODE tags. e.g.

int old;
void loop()
{
    i = i + 1;
    tft.setCursor(0, 30);
    tft.setTextSize(3);
    tft.setTextColor(WHITE);
    tft.print("IN: ");
    tft.setCursor(50, 30);
    tft.setTextColor(BLACK);
    tft.print(old);
    tft.setCursor(50, 30);
    tft.setTextColor(WHITE);
    tft.print(i);
    tft.println();
    old = i;
    delay(1000);
}

Yes, I tried your solution. It works fine. But there is a neater way:

void loop()
{
    i = i + 1;
    //    tft.fillScreen(BLACK);
    tft.setTextColor(WHITE, BLACK);  //foreground, background
    tft.setCursor(0, 0);
    tft.setTextSize(3);
    tft.print("IN: ");
    tft.print(i);
    tft.print("    ");   //trailing spaces
    tft.println();
    delay(1000);
}

As an exercise for the reader, what statements could you remove from the loop() and put in the setup() ?
What happens when i goes from 32767 to -32768 ?
Why did I add the trailing spaces?
Is there a different way to overwrite old numbers?

David.

david_prentice:
{...} As an exercise for the reader, what statements could you remove from the loop() and put in the setup() ?
What happens when i goes from 32767 to -32768 ?
Why did I add the trailing spaces?
Is there a different way to overwrite old numbers?
David.

It is only example for dynamic info visualing problem. In real project will be loop for displaying heater temperature, calculating his power and coefficient of efficiency.

Lundin:
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)

I succesful at uint16_t identifier = 0x9341;
Many thanks

Why is that reset nedeed ? Can I not Just leave it disconnected and configure it on A6?

And is the read nessesary?

Post a link to the actual display that you have.

Yes, all the MCUFRIEND shields need the Reset pin.
If you know which controller you have, it might be possible to make a hardware modification.

If you know which controller you have, you do not need to read the ID.

Note that Ebay vendors often lie about controllers.

David.