Go Down

Topic: 2.4 inch TFT touch LCD Screen Module For Arduino UNO R3 SD low price jocks (Read 212515 times) previous topic - next topic

hadise

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 :(
can you help me for doing this work ?

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.

hadise

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

programmerjeff

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:

- mcufriend 2.4" TFT LCD (9341)
- identifier 0x9341
- Link to where I bought it


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

Code: [Select]

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:

Code: [Select]

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() );

f8vpe

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.


scgECU

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!

david_prentice

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.

scgECU

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

david_prentice

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.

scgECU

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

david_prentice

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.

studentas

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.

Code: [Select]
#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);}

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.

studentas

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 :( but result suitable
I think must be more intelligent solution, without gaming with coordinate and paint eraser ...

Code: [Select]
#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 :( 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 :)
Code: [Select]
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);}

Go Up