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.
Bookmarks