Get Touch coordinates

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Get Touch coordinates

    Hello,

    I want do develop an application that gets the X an Y coordinates of the point which was touched in a LCD. I read about the functions GUI_TOUCH_GetState(), but I don't know how to implement it. Do I need to create a callback function? Does anybody has a simple example?

    Any tip will be very helpful,
    Thanks
  • Hi marcosbontempo,

    GUI_TOUCH_GetState() will tell you if touch screen is pressed or not.. There is another API called "GUI_TOUCH_StoreState".. This you can call from interrupt routine .. As soon as screen is touched you should get an interrupt then use this api to store the co-ordinates.. you can make use of this sample code :
    Sample\GUI_X\GUI_X_Touch_StoreState.c
  • Hi,

    Yes, amit is right.

    You need to read touch data from the touchcontroller and fill the emWin touch buffer with a call of GUI_TOUCH_StoreState().

    Attached you will find a sample file which should show how we do it in most cases. Of course this depends on the used touch controller.

    The sample attached is from project for a STM32F4x9i Eval.

    Regards,
    Sven
    Files
    • PIDConf.zip

      (1.2 kB, downloaded 654 times, last: )
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.