Announcement

Collapse
No announcement yet.

Problem with touch screen

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with touch screen

    We use uLCD43PT. We created screens using Extended Graphics Environment. The LCD is interfaced with Arduino Due. When coordinates of the image is queried using the functions: touch_Get(TOUCH_GETX) and touch_Get(TOUCH_GETY), we get coordinate values other than the one we have for the object shown during creation of the object.

    Please help to resolve this problem.

  • #2
    Hello

    Welcome to the forum.

    touch_Get(TOUCH_GETX) and touch_Get(TOUCH_GETY) will return the pixel co-ordinate of the screen where it is touched rather than the co-ordinates of the image.

    You can use the img_Touched which will return the number of the image touched. You can find more information about the img_Touched function on page 153 of this datasheet https://www.4dsystems.com.au/product...nual_R_2_0.pdf

    I hope this helps

    Best regards

    Paul

    Comment


    • dvvr
      dvvr commented
      Editing a comment
      Thank you! Paul, for the quick reply. Is this document applicable for uLCD43PT Module?
      Earlier we tried using the function img_Touched(), but the return value we get is 65535.

      Below is the code snippet:
      -----------------------------------
      Below code segment displays the button:
      ------------------------------------------------------
      /* Winbutton1 -> SETUP */
      Display.img_ClearAttributes(hndl, iWinbutton1, I_TOUCH_DISABLE); // Winbutton1 set to disable touch
      Display.img_SetWord(hndl, iWinbutton1, IMAGE_INDEX, state); // Winbutton1 where state is 0 for up and 1 for down
      Display.img_Show(hndl, iWinbutton1); // Winbutton1 show button
      ------------------------------------------------------
      Below code segment detects if the button is pressed:
      ----------------------------------------------------------------------
      touch = Display.touch_Get(TOUCH_STATUS); //Get the touch status
      n = img_Touched(handl, -1);
      if(touch == TOUCH_PRESSED) //if touch status is pressed or not?
      {
      Serial.print("n = ");
      Serial.println(n);
      }
      ---------------------------------------------------------------------
      When execute this, we get "n" value as '65535'.

      Please let us know what is wrong with this code?
      Last edited by dvvr; 13th July 2018, 03:24 PM.

  • #3
    Hello,

    Sorry the right document for your display is this one https://www.4dsystems.com.au/product...nual_R_2_0.pdf and you can find details of image touched on page 156.

    The value 65535 is -1 as a signed integer which means no object touched. Would it be possible to send me your whole code, or just your full setup routine.

    Best regards

    Paul

    Comment


    • dvvr
      dvvr commented
      Editing a comment
      Please let me know, how can I send the code. E-Mail or other means???

  • #4
    Hi,

    You can use your open support ticket to send your code, just zip it and attach it. at the bottom of your message.

    Best regards

    Paul

    Comment


    • dvvr
      dvvr commented
      Editing a comment
      Hi Paul,

      I have sent the code by attaching it in the support ticket.

      Thanks & Regards,
      Vishnuvardhan
Working...
X