TFT touch screen problem.

Hello all

Ive made a little arduino weather station and my problem is that i cant find anywhere some touchscreen library,i am using arduino due..everything works fine,i just cant find it...

i would be very happy if someone could give me some hints on that :smiley:

its the famous mcufriend 2.4 inch tft with sd slot :smiley:
i managed to make it work on arduino uno,but who needs uno when there is due :smiley:

and here is what i made with it.

one more question,how to improve refreshing rate of the display,i mean i dont want it to redraw whole screen over and over again,just the digits..although due can handle it nicely..

thank you all in advance :smiley:

Ok,i figured out the refreshing part :smiley:

Which library are you using to drive the display?

If UTFT, there is a companion library UTouch......

Regards,

Graham

no its not Utft :smiley: its some tftlcd library i found on github,the same library that i used to drive the tft with uno..just changed the pins and thats it..now i found something..and its doing something :smiley: but not exactly what its supposed to do..weird values :smiley:

You have plenty of stuff 'doing something' then. Well done!

Regards,

Graham

Well i have some feeling that i have to hit my display with a rock to work :smiley:
no just touchscreen is not working properly..works on uno,but its not working on due.
I tried right now utft libraries and nothing :smiley:

Can you at least provide some code or links to the libraries you are using.....

UTFT(with several exceptions) works (or can be made to) for most displays and handles touch functions well....

'Not working' is not particularly descriptive...

Regards,

Graham

sorry :smiley: im new to all this :smiley: sorry again..

here is the display im using

http://www.mcufriend.com/product/html/?66.html

the library i am using for that display is (Adafruit tftlcd library) that part works fine..i mean displaying content is ok.

but touchscreen..i dont know what to say about that one,because only one half worked..
the same adafruit touch library i downloaded with display library,failed to compile

i got something like this.

In file included from C:\Users\molna\AppData\Roaming\Arduino15\packages\arduino\hardware\sam\1.6.4\variants\arduino_due_x/pins_arduino.h:20:0,
from C:\Users\molna\Documents\Arduino\libraries\Touch-Screen-Library-master\TouchScreen.cpp:6:

and a lot more under it :smiley:
then i tried the same library but its written that its for due..that one compiles just fine..but in serial monitor values are just crazy :smiley:

#define YP A2 // must be an analog pin, use "An" notation!
#define XM A3 // must be an analog pin, use "An" notation!
#define YM 8 // can be a digital pin
#define XP 9

you guys know a lot more than me..how can i know which pin is which? because on the back of the display,on one side i have LCD-D pins from 0-7

and on the other side i have LCD-rst LCD-cs LCD-rs LCD-wr LCD-rd..and few more pins for sd card reader :smiley: i dont understand really how can i define something i dont know? :smiley: sorry,maybe im too stupid for this,but im trying :smiley:

Sorry for being stupid..i just saw the datasheet..ignore those pin questions :smiley: i should just let this go for tonight..im too tired .

Nobody is stupid! They just haven't learnt what they need to know yet!! :wink: But lack of sleep does not help :P!

Let's pick this up again tomorrow..... I will help if I can....

Regards,

Graham

Thank you very much for your help :smiley:

Could you provide a picture of the rear of your display?

Regards,

Graham

well at the moment im unable to do that,but here is the driver S6D0154 of that display :smiley: i know that for sure :smiley:

Maybe this link will be helpful to you.... http://misc.ws/2015/01/24/lcd-touch-screen-information/

Regards,

Graham

Majority of LCD (display) libraries are based on UTFT and being "universal" require few settings / modifications.
The basic one is - select processor - AVR ( Uno ) or ARM (Due) or derivatives. Next one is some identification of your LCD ( 2.4 inch xyz brand). You may also need to identify the (connection ) data bus ( SPI, I2C, 8 bits etc.)
The display and touch control "pins" are separate , but you already discovered that.
Most of the "settings" are documented in source code itself, sometime in not to obvious places.
IMHO the main "secret" of UTFT library is that it is coded for SPECIFIC shields , I/O hardware pins, and this is not very well advertised. But IT IS documented!
So RTFM first is my advise to you.
Good luck.

well..i tried more or less all of them..and display is working :smiley: but touch is not :smiley:

i think ill have to struggle a little bit with this..or ill never learn anything..something is wrong,and im doing something wrong for sure,just i cant figure out what exactly.

when i switch display to uno..touch is working fine with the adafruit library..
on due..display is working great :smiley: but touch is not...i managed to make it work somehow..but its working reversed? :smiley: i have x,y and preassure values..but when i press the display everything stops :smiley: so..almost ok but reversed :smiley:

An 'easy' way to reverse your touch, would be (for example)

myxtouch = displayxsize-xtouch; //To flip horizontal.
myytouch = displayysize-ytouch; //flip vertical.

Substitute the variable names for what you have.

Regards,

Graham

no no :smiley: you dont understand me :smiley: when im not even touching the display im having all kinds of values..x..y...preassure :smiley:

as soon as i touch the touchscreen everything stops :smiley:

i dont have inverted axis,i have inverted the concept of touchscreen :smiley:

Sorry then pal, too far past my bedtime to understand this. :fearful: :sleeping:

Regards,

Graham

Dont worry :smiley: ill figure it out..at least i hope so :smiley: