tft touch function X and Y axis inverted??

Hi all, I've started a telescope mount project based on rDuinoScope "_2.3.1_Boiana_EQ_Otto_14c", I'm a newbie, but so far the code has compiled fine and runs on my rDuinoScope hardware, but the issue is that the X and Y axis of the touch control is flipped, so in order to press a button in one corner I have to press the opposite corner etc. HELP eheh.

link to the tft and shield I have: 3.2" TFT 400*240 SD Touch Module With Shield for Arduino Due - emartee.com

link to my github where I've posted the code I was compiling and also the libraries I'm using for the touch screen:

Thanks all!

Alpittzo:
Hi all, I've started a telescope mount project based on rDuinoScope "_2.3.1_Boiana_EQ_Otto_14c", I'm a newbie, but so far the code has compiled fine and runs on my rDuinoScope hardware, but the issue is that the X and Y axis of the touch control is flipped, so in order to press a button in one corner I have to press the opposite corner etc. HELP eheh.

link to the tft and shield I have: 3.2" TFT 400*240 SD Touch Module With Shield for Arduino Due - emartee.com

link to my github where I've posted the code I was compiling and also the libraries I'm using for the touch screen:
https://github.com/Alpittzo/rDuinoScope

Thanks all!

In the Arduino IDE under Preferences turn on verbose output on compile and upload.

try compiling once again and post the error messages copied from the Arduino IDE.
please use the proper code tags.

Hi Artisticforge thanks for the reply! compiling and upload is successful and as such I don’t have any errors specifically to copy, but I still have the touch orientation issue. would you still like me to post the verbose output from compiling and uploading? Or shall I post my main sketch instead?
Thanks again!

You have 3.2" TFT 400*240 SD Touch Module With Shield for Arduino Due.

You can either use UTFT library after enabling this in HW_ARM_defines.h:

// ElecHouse TFT LCD/SD Shield for Arduino Due
// -------------------------------------
// Uncomment the following line if you are using this shield
//#define EHOUSE_DUE_SHIELD 1
//
// For this shield: RS=22, WR=23, CS=31, RST=33
//********************************************************************

and use any of these Touch libraries: URTouch.h, ADS7843.h or XPT2046.h

Think about it. Any Touch controller chip is going to be glued onto your TFT in one way.
It will probably be wired in Portrait mode. If you are Landscape, you have to swap X, Y.

I have never used the EHOUSE Adapter. It seems to put the SPI Touch controller on GPIO pins. So you will have to bit-bash it anyway.

I suggest that you gain familiarity with an established library like UTFT first
If you want to use a GFX-style library, you could use MCUFRIEND_kbv with a special:

//#define USE_ELECHOUSE_DUE_16BIT_SHIELD    //Untested yet

but note that I have never tested this personally.

Most Touch screens require some Calibration but to start with, just swap X, Y and directions as required.

When you are familiar with a Graphics library, you can concentrate on your project (whch looks pretty complex to me)

David.

david_prentice:
You have 3.2" TFT 400*240 SD Touch Module With Shield for Arduino Due.

You can either use UTFT library after enabling this in HW_ARM_defines.h:

// ElecHouse TFT LCD/SD Shield for Arduino Due

// -------------------------------------
// Uncomment the following line if you are using this shield
//#define EHOUSE_DUE_SHIELD 1
//
// For this shield: RS=22, WR=23, CS=31, RST=33
//********************************************************************




and use any of these Touch libraries: URTouch.h, ADS7843.h or XPT2046.h

Think about it. Any Touch controller chip is going to be glued onto your TFT in one way.
It will probably be wired in Portrait mode. If you are Landscape, you have to swap X, Y.

I have never used the EHOUSE Adapter. It seems to put the SPI Touch controller on GPIO pins. So you will have to bit-bash it anyway.

I suggest that you gain familiarity with an established library like UTFT first
If you want to use a GFX-style library, you could use MCUFRIEND_kbv with a special:


//#define USE_ELECHOUSE_DUE_16BIT_SHIELD    //Untested yet



but note that I have never tested this personally.

Most Touch screens require some Calibration but to start with, just swap X, Y and directions as required.

When you are familiar with a Graphics library, you can concentrate on your project (whch looks pretty complex to me)

David.

Thats excellent thanks David I'll try that! :grin: