Author Topic: (touch not working) SainSmart MEGA2560 R3 + 7" 7 Inch TFT  (Read 5196 times)

0 Members and 1 Guest are viewing this topic.

Offline TommyTopic starter

  • Robot Overlord
  • ****
  • Posts: 123
  • Helpful? 3
(touch not working) SainSmart MEGA2560 R3 + 7" 7 Inch TFT
« on: January 26, 2016, 06:33:54 AM »
Last week I received one of the units in the link below, after downloading the UTFT and UTOUCH
libraries I was able to get the Display to work with the arduino setup codes listed below, but after
spending days searching the net for different setup codes I still can't get the Touch function to work.
with these codes, it response to a touch but, only returns -1 myTouch.getX(), and myTouch.getY();

void loop()
{
  while (true)
  {
    if (myTouch.dataAvailable())
    {
      myTouch.read();
      x=myTouch.getX();
      y=myTouch.getY();



after doing a calibrations it returns values if 0 for both X,Y but does give a pressure value.   
 


link to the item: http://www.sainsmart.com/sainsmart-mega2560-r3-7-7-inch-tft-lcd-screen-sd-card-slot-tft-shield-for-arduino.html

arduino setup codes:
UTFT          myGLCD(CPLD,38,39,40,41);
UTouch        myTouch(6,5,4,3,2);
UTFT_Buttons  myButtons(&myGLCD, &myTouch);
void setup()
{
  myGLCD.InitLCD();
  myGLCD.clrScr();
  myGLCD.setFont(BigFont);

  myTouch.InitTouch();
  myTouch.setPrecision(PREC_MEDIUM);
 
  myButtons.setTextFont(BigFont);
}



because I get good display results and at least it responses to pressure I'm thinking
it's my setup codes.

anyone had a chance to work with this unit and get the touch working?

Tommy

 


Get Your Ad Here

data_list