I am having problems with my Cartesian coordinate system using the TFT library. It seems that even though the X & Y points are mapped properly, they still do not give me the correct Cartesian coordinates when I'm doing any of the functions that are supplied by the library. It seems that the X&Y points on every single input are reversed; the Y is X., and the X is Y.
any help or suggestions would be appreciated.
TY, houdinihar
What I'm wondering that is what do I need to do to correct the coordinate system if possible, or do I need to just reverse the way I use my data?
You need to check how the library expects the coordinates to provided. Some libraries/drivers use function(x,y) whereas others use function(y,x).
Pete
Hi Pete. After looking through the .h and .cpp files, everything seems to be in (x, y) format.
All of the functions are written that way. And in the Touchscreen.ino example, same thing; plus x and y are mapped correctly. Even if I try to remap the x and y, it doesn't work. It's puzzling to say the least.
houdinihar
Something that I did see yesterday was in the TFT.h there is an assignment of the size that is not correct. X is assigned size 240 and Y is assigned size 320 which is bass-ackwards of the normal coordinates that I'm looking to use, which is to have the X-axis on the longer side. Unfortunately changing that has no influence whatsoever on the x/y pixel placement. If I use the Tft.setPixel( x,y,color); just to see where a colored pixel will show up----and then try to use normal Cartesian coordinates, it absolutely never works correctly.
I can get the functions to work but not correctly placed on the screen unless I reverse the x/y values myself.
Still looking for help here.
houdinihar