Go Down

Topic: I need help on how to solve "mirror image display on 3.2" TFT LCD (Read 454 times) previous topic - next topic

felixanosike

Hi all! I bought a TFT 3.2" touch screen from china, I am using it on arduino mega, but when I load a sketch the imege show in a mirror form. the touch works in opposite side. please can ny one help me.
Please note that I am using Rinky-Dink Electronics UTFT library.
Code: [Select]
#include <UTFT.h>
#include <URTouch.h>

UTFT    myGLCD(CTE32HR,38,39,40,41);
URTouch  myTouch( 6, 5, 4, 3, 2);
extern uint8_t BigFont[];

int x, y;
char stCurrent[20]="";
int stCurrentLen=0;
char stLast[20]="";

void setup()
{
  myGLCD.InitLCD();
  myGLCD.clrScr();

  myTouch.InitTouch();
  myTouch.setPrecision(PREC_MEDIUM);
}

void loop()
{
  long x, y;
 
  while (myTouch.dataAvailable() == true)
  {
    myTouch.read();
    x = myTouch.getX();
    y = myTouch.getY();
    if ((x!=-1) and (y!=-1))
    {
      myGLCD.drawPixel (x, y);
    }
  }
}




PaulS

Code: [Select]
int x, y;

void loop()
{
  long x, y;

Why do you have global and local variables with the same name but different types?

Do you really NEED longs to hold the position where you touched the screen? Just how big IS the screen?

Quote
Please note that I am using Rinky-Dink Electronics UTFT library.
Please note that that "link" doesn't work, nor does the "link" to the hardware.
The art of getting good answers lies in asking good questions.

Go Up