BUTTON statement without repeat rate variable?


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2013
    Posts
    1,078

    Default BUTTON statement without repeat rate variable?

    Hello.

    I have certain project, which uses 11 buttons. They have no repeat, but BUTTON statement requires separate BVAR variable (button variable) to be declared for all buttons. Is there a way to skip usage of this variable?

    I know that I can do without BUTTON statement at all, but I like they way it works (debounce and code stopped until you release button).

  2. #2
    Join Date
    Apr 2011
    Location
    Welches, Oregon
    Posts
    198


    Did you find this post helpful? Yes | No

    Default Re: BUTTON statement without repeat rate variable?

    A quick check of the manual does not show the square brackets "[ ]" typically used to denote optional parameters; perhaps one might use the same variable on all buttons however- presuming it is initialized to zero before each use.

    Code:
    If Button = pressed then
      pause 100 'debounce
      HOLDINGBUTTON: If Button = Pressed then  'still depressed
        pause 100 'wait for release of button
        Goto HOLDINGBUTTON
      Elseif Button = NotPressed
        Do something
      EndIf
    Endif

Similar Threads

  1. HEX2 statement result to variable?
    By CuriousOne in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th January 2014, 14:47
  2. Repeat .... UNTIL code
    By SKOLS1 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 22nd April 2012, 00:11
  3. Pin won't stay high during Repeat...Until loop??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th August 2009, 23:57
  4. capture/repeat data ?
    By Sam in forum Serial
    Replies: 44
    Last Post: - 27th November 2006, 03:19
  5. Push Button 'Menu' to Choose Variable.
    By Tissy in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 10th March 2005, 07:00

Members who have read this thread : 1

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