1 switch, 1 pin, "single click, double click..."


Results 1 to 13 of 13

Threaded View

  1. #8
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191


    Did you find this post helpful? Yes | No

    Post

    Quote Originally Posted by Acetronics View Post
    Hi, Steve

    Might work with two " Button" commands following each other, as debounce time is effective ONLY if condition TRUE ...

    he,he ...

    Alain
    I haven't use Button -command too, but couple of IF - THEN with PAUSE works for me.
    Code:
    IF But = 0 then         'Button is pressed and debounce detections starts 
        PAUSE 100           'wait 100ms or some other more suitable time
        IF But = 0 then     'if button is still held down then do something
                            'start timer or loop for 2nd button press detection ...
    I think, some time window must be defined otherwise you will be waiting that other press forever...

    Also nice to hear that Steve had similar thoughts

    BR,
    -Gusse-
    Last edited by Gusse; - 28th March 2009 at 10:04.

Similar Threads

  1. RS485 bus - starting probem
    By wurm in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th January 2010, 13:35
  2. Optimizing DIV
    By skimask in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 22nd September 2008, 04:58
  3. Keypad unlock (as in garage door possibly)
    By Fred in forum Code Examples
    Replies: 5
    Last Post: - 2nd April 2006, 04:26
  4. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  5. DS1820 headache
    By Calco in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 12th August 2004, 00:28

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