Help with example button program


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Help with example button program

    Hi,
    If it's really not debouncing properly - even with 65ms worth of "debounce time", you've got to have a really bouncy switch... :-)

    Are you sure that it's not the autorepeat feature you're seeing? If you change the value 40 in your example to 255 it will still debounce but not autorepeat - according to the manual.

    /Henrik.

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default Re: Help with example button program

    Hi,

    I'm not so sure of:
    Code:
    button PB1, 0, 40, 5, B1, 0, main
    I'd try ...
    Code:
    ...
    B1 = 0 ; always think to place it just before " button " command ...
    button PB1, 0, 255, 0, B1, 1,yes 
    no:
    Pause 20 ; pace the scanning ... not compulsory
    goto main
    yes:
    toggle LATCH1
    toggle LED1
    ...
    that's the way It works for me for years in such a use ... note I think ( and observed ) the debouncing only occurs if condition is true (1) ...
    so, sometimes, you have to "twist" the test somewhat ...

    Alain
    Last edited by Acetronics2; - 23rd March 2014 at 16:56.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. [Help] PIC 16F886 with 9 button program with CCS
    By keviltran in forum General
    Replies: 1
    Last Post: - 8th October 2013, 21:40
  2. Toggle program branch ussing interrupot by button?
    By CuriousOne in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 14th September 2013, 09:58
  3. Replies: 1
    Last Post: - 23rd May 2009, 09:22
  4. button help
    By Kalind in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 14th October 2008, 13:12
  5. Program Code and Program Memory
    By DenFrod in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th February 2007, 14:51

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