3.5" TFT 320x480 + Touchscreen HXD8357D

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jamesobrady
 
Posts: 2
Joined: Tue Jan 09, 2018 4:56 am

3.5" TFT 320x480 + Touchscreen HXD8357D

Post by jamesobrady »

Hi there,
I have recently received this and am running the sample tftpaint sketch with a Mega 2560.
My issue is the touchscreen seems to be mirrored around the center of the screen.
If I swipe from left to right, the paint draws from right to left.
If I move my finger down, the paint draws upwards.

I cannot for the life of me figure out how to solve this-Im an arduino newbie.
If i physically swap the Xp Xm and Yp Ym pins on the mega it works as it should but I imagine this is not a good solution.
Changing the mapping of the pins in the sketch results in the touchscreen not working.

Any help or advice is sincerely appreciated.
Thank you.

User avatar
jamesobrady
 
Posts: 2
Joined: Tue Jan 09, 2018 4:56 am

Re: 3.5" TFT 320x480 + Touchscreen HXD8357D

Post by jamesobrady »

I found a solution to my issue here:
In the code if I change this:

Code: Select all

p.x = map(p.x, TS_MINX, TS_MAXX, tft.width(), 0);
    p.y = map(p.y, TS_MINY, TS_MAXY, tft.height(), 0);
to this:

Code: Select all

  p.x = map(p.x,  TS_MAXX, TS_MINX, tft.width(), 0);
    p.y = map(p.y,  TS_MAXY, TS_MINY, tft.height(), 0);
It works as expected.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”