Button subfunction 16F628


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi Jųan,

    The problem might be related to re-using variables in the BUTTON commands.

    Button PORTA.7,1,200,255,B0,1,incNum
    Button PORTA.6,1,200,255,B1,1,decNum
    Button PORTA.4,1,200,255,B0,1,dummy1
    Button PORTA.1,1,200,255,B1,1,dummy2
    Button PORTB.1,1,200,255,B2,1,number2Setup

    Within any single loop each BUTTON command must have it's own variable to count the passes, and that variable can't be used anywhere else in the program.<br><br>
    DT

  2. #2
    Join Date
    Jul 2005
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    Thanks for your reply Darrel, I tried that but the auto repeat function didnt work when using unique Bvariables. Also the displayNum2 still counted on its own. I have attached a diagram of how I've connected the switch.

    Juan
    Attached Images Attached Images  
    Last edited by Jųan; - 11th August 2005 at 01:39.

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Did you make ALL of the button commands use a separate variable? There are 8 button commands, you should have B0-7 variables.

    Also, try putting a CLEAR statement at the top of the program. According to the manual... The variable must be initialized to 0 prior to use.<br><br>
    DT

Similar Threads

  1. Sony SIRC IR Issue
    By Ryan7777 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 8th August 2015, 08:10
  2. Button problem driving me crazy!! Please help!
    By bearpawz in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 20th November 2007, 14:46
  3. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43
  4. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  5. Button Push within 3 second Window
    By Tissy in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 22nd December 2005, 10:06

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