-->
Page 1 of 2

tft.checktouch() Axis Problem

PostPosted: Wed Dec 21, 2016 4:10 pm
by Daniel Saiz
hello,
first of all, congratulations for this fantastic project !! i love it
I have a problem with TFT ILI9341 display
The displays works perfectly, and also the tft touch controller, but when I used the sample in the documentation of tft.checktouch().
Code: Select alltft.setup(16, 4, 3)

tft.touch.setup(15)

but1 = tft.obj.button("PUSH", 5,5,120,50,3)

chk1 = tft.obj.checkbox("Check Me", 5,100,40,1, 3)

lab1 = tft.obj.label("press", 0,190,200,24,3)

touchbranch [touchme]

wait

[touchme]

touch_obj = tft.checktouch()

serialprintln "checktouch " & touch_obj

if touch_obj = but1 then

  tft.obj.invert(but1)

  tft.obj.setlabel(lab1, "button")

end if

if touch_obj = chk1 then

  tft.obj.setlabel(lab1, "checkbox")

  tft.obj.invert(chk1)

end if

return

The axis coordinates are reversed and i canĀ“t press any object, the coordinates of the object are in the opposite corner.
It is a tft problem?

Thank you

Re: tft.checktouch() Axis Problem

PostPosted: Thu Dec 22, 2016 9:45 am
by PhilTilson
I have no personal experience of this object, but from the documentation, I would assume that the command you have used - tft.init(16,4,3) - causes the display to be rotated through 270 degrees.

Have you tried using tft.init(16,4,1) instead, to see if that solves the problem?

If it does, this still suggests that there is a discrepancy between the display and the touch aspects of this object, which may require further study.

Phil

Re: tft.checktouch() Axis Problem

PostPosted: Thu Dec 22, 2016 4:25 pm
by Daniel Saiz
Hello PhilTilson,
thank you for your reply,

Yes, i tried different configurations of tft.setup(16, 4, 3),tft.setup(16, 4, 1), but it does not solve the problem.

Re: tft.checktouch() Axis Problem

PostPosted: Mon Dec 26, 2016 3:43 am
by lpservices
Hello,
I had the same problem with this displays,
I made a patch in de touchcontroller routine to return the correct coordinates,
You will have to recompile from source to apply it.
If you are able to do this, let me know,
I will post the patch

Happy thinkering
Lpservices