I want to select either of two display routines to feed a common display.
I thought that using a button to toggle a "flag", and using that "flag" value
to select which routine to use would be the route to go.
However, I dont want to have to hold the button down whilst the whole program loops
so perhaps an interrupt is the way to go.
Does this pseudo code lead me in the right direction?
I have never dealt with interrupts before so any pifalls in my thinking here.
Toggle flag is a concept, not a command.
Thanks, Russ
I thought that using a button to toggle a "flag", and using that "flag" value
to select which routine to use would be the route to go.
However, I dont want to have to hold the button down whilst the whole program loops
so perhaps an interrupt is the way to go.
Does this pseudo code lead me in the right direction?
Code:
setint %00000010,%0000001
do
lots of things
if flag =1 gosub display 1
else gosub display 2
loop
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
interrupt:
toggle flag
do
loop until pin 1=0
setint %00000010,%0000001
return
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Toggle flag is a concept, not a command.
Thanks, Russ