Page 1 of 3
TFT ILI9341 display touch controller x axis reversed
Posted:
Sat Jul 23, 2016 7:15 am
by lpservices
hello,
this is my first entry in this forum,
first I must say espbasic is a wonderful achievement.
But I have a problem,
Recently I aquired a few TFT ILI9341 displays from Ebay
The displays works fine, I used the sample in the documentation
For some reason the X-axis coördinates coming from the touch controller is reversed
This is not a mayor problem if I check the coordinates myself in a routine, but the tft.checktouch() routine always comes back with -1, as the coordinates don't match any object
Is there a way to reverse the X-axis, and perhaps also the Y-axis, by using extra parameters in tft.touch.setup(T_CS pin)?
for example :tft.touch.setup(T_CS pin,true,false) -> reverse X-Axis,keep normal oriantation Y-axis
Kind regards from Belgium
Luc Pauwels
Re: TFT ILI9341 display touch controller x axis reversed
Posted:
Sat Jul 23, 2016 9:55 pm
by forlotto
Good question I do not currently have this touch screen you are talking of no way to really test but I was thinking about getting a touchscreen and trying it out this winter so if you figure it out before this time let me know share your info and your project will make life a lot easier I've shared nearly everything I've figured out with the community in hopes that others would learn and do the same. I hope to see others chime in and share with the community as well this is after all what has got us all this far a consistent sharing of information on how to accomplish different tasks hope to see your info posted.
I do know there is a way on some controllers to rotate the screen etc... It is also possible that your touch screen was affixed upside down I have seen this before with commercial touch screens normally there is a calibration mode that will fix this but in this case I am unsure of the specifics of the monitor or the controller how it is setup to work.
Possibly someone with this touch screen who has got it working will chime in on this may be a little bit summer time things are busy everywhere but slow online often.
Re: TFT ILI9341 display touch controller x axis reversed
Posted:
Sun Jul 24, 2016 4:34 am
by lpservices
Hello,
I figured it out
In the routine ReadTouchXY() in Eval.ino I changed the way the x coordinates are converted depending on the rotation of the screen.
I rebuild espbasic with the modified routine and everything check out now.
I noticed there is a stub routine tft.calibrate, maybe I can implement that, to take care of rotation issues
Also I noted the there a lot of delay(0) calls, any explanation for that?
Re: TFT ILI9341 display touch controller x axis reversed
Posted:
Sun Jul 24, 2016 9:53 pm
by forlotto
unsure of delay(0) really dunno why you would have this...
As far as the rest of the post this sounds excellent if you do figure out possibly just a method of rotation possibly this would be way cool please do share.
As always share and share alike in order to improve this thing we need small contributions from users like yourself.
If you would care to share the build the lines you edited with whichever code you replaced this would be cool the real improvement would be to enable rotation through a calibration this would be most excellent.
Thanks for sharing what you found thus far.
The delays are nil so that kind of has me stumped maybe something to do with operation if not it is possible that you may remove them and it will operate fine?