one button-two operations


Results 1 to 14 of 14

Threaded View

  1. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Code:
    CounterA Var Byte
    CounterA=0
    Start:
        If PORTB.0=0 then 
            If CounterA<=1 then        
                CounterA=CounterA+1
                else 
                   CounterA=0
                endif
            endif
        While PORTB.0=0 : Wend : pause 50
        BRANCHL CounterA,[LabelOne,LabelTwo,LabelThree]
        '    
        ' stuf and other    
        '
        Goto Main
    
    LabelOne:
        ' Stuff 
        goto Main
    
    LabelTwo:
        ' Stuff 
        goto Main
    
    LabelThree:
        ' Stuff 
        goto Main
    The use of an internal Counter may reduce the code size too... look for RA4/T0CKI. Just read the TMR0 register and play with.
    Last edited by mister_e; - 16th July 2006 at 09:36.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43
  3. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  4. Button Push within 3 second Window
    By Tissy in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 22nd December 2005, 10:06
  5. Button subfunction 16F628
    By Jųan in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 19th August 2005, 16:44

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