Hello,

I want to do the following thing, I have 2 pulsers one in rb0 and another one in rb1 and a LED in rb2 and rb3. I Need to on and off with the same pulser in rb0 the LED in rb2 and want to on and off with the same pulser in rb1 the LED in rb3.

Since I can do it. Thanks







Quote Originally Posted by mister_e
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.