FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Author Topic: EVE down signal: sensing continuous  (Read 7735 times)

scorpioprise

  • Newbie
  • *
  • Posts: 18
    • View Profile
EVE down signal: sensing continuous
« on: March 19, 2019, 04:43:20 PM »

Hi there, have you any idea on how to detect that you have a long click on (for instance) a imagebutton ( and do something different in your code ) ?
It involves the down signal, ok, but how would you modify it?

Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 892
    • View Profile
Re: EVE down signal: sensing continuous
« Reply #1 on: March 20, 2019, 12:53:39 PM »

Hello,

You can check for a pen down condition where the REG_TOUCH_SCREEN_XY becomes not-equal-to 0x80008000 and likewise a pen-up condition where it changes from a coordinate to value 0x80008000. You can use a small state machine or if-else routine in your code to track the previous and current values and therefore detect pen-down and pen-up conditions.   You can use these along with a counter in your MCU code to detect the length of touch that was held on the screen.

As the item is normally a tagged object, you can monitor the tag value and count the number of polls of the tag register where the tag remains at the value of the object being monitored. This can be used to determine how long the touch was held for.

You can also combine these two techniques to allow you to detect both how long a touch is held and for how long it was on the particular tagged item being monitored. e.g. if you detect pen-down, also poll the TOUCH_TAG register to confirm that the touch is actually on the image button whilst waiting for the pen-up.

If you use interrupts, there are also interrupts available for both touch detect and the tag value changing which could be used to reduce the polling required in the above cases.

Best Regards,
FTDI Community

 



Logged