Capacitive touch - trapping a long press?


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    699


    Did you find this post helpful? Yes | No

    Default Re: Capacitive touch - trapping a long press?

    I was thinking of some logic outside the interrrupt routine, in the main program. In the interrupt routine you find the variables Last_High_Reading and Current_Reading. Even though the main program is stuck in a loop, it will still be going to the interrupt routine. I was thinking of something like this,

    Cnt = 0
    REPEAT 'Main program will be in this loop until sensor is released.
    Cnt = Cnt + 1
    Pause 2
    If Cnt > 500 then RETURN 'A long press was detected. Exit sub-routine.
    UNTIL Current_Reading > 0.8*Last_High_Reading
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  2. #2
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Capacitive touch - trapping a long press?

    Thanks guys....I'll give both of those ideas some serious consideration as I hadn't considered either.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts