I suspect you haven't posted the full code nd s others ave mentioned, its difficult to understand your problem. My take on it is initial observations suggest you need to issue a 'setintflags' command and have a sub-routine labelled 'interrupt', which will also need to reset the flags and re-issue the interrupt command before 'return'.
untested but maybe something like this...
Code:
#picaxe 20x2 'this tells the P.E. whch chip is bieng used
main:
HintSetup %00000010 'sets the interrupt pin
setintflags %00000010,%00000010 'sets the flags condition for the interrupt
do
sleep 10
loop
interrupt:
b0=pinsC & %00000111 / 2 'masks all but the first 3 pins and shifts one place to
'the right for correct routine selection
on b0 gosub first,second,third 'and this selects the correct routine
flags=0 'reset the flags
setintflags %00000010,%00000010 'and re=issue the interrupt command
return
first:
'de-bounce the switch
'DO SOMETHING
return
second:
'de-bounce the switch
'DO SOMETHING
return
third:
'de-bounce the switch
'DO SOMETHING
return
I got your code, thanks. I put code and changed, when first start then main2 ready sleep, and then press Hint then wake up while press any first, second, and three do something well, now back second time go sleep again so cant do interrupt anymore like freeze, turn off the power then startup working once, and cant do second time, maybe something is not right with code
wait 2
serout 1,T9600, (254,12)
'pause 30
'serout 1,T9600, (254,1," Welcome")
'pause 30
serout 1,T9600, (254,194,"World")
wait 4
main:
for b1= 1 to 200
if pinC.2=1 then first
if pinC.1=1 then second
if pinC.0=1 then three
pause 25
next b1
main2:
HintSetup %00000010 'sets the interrupt pin
setintflags %00000010,%00000010 'sets the flags condition for the interrupt
do
sleep 10
loop
interrupt:
b0=pinsC & %00000111 / 2 'masks all but the first 3 pins and shifts one place to
'the right for correct routine selection
on b0 gosub first,second,three 'and this selects the correct routine
flags=0 'reset the flags
setintflags %00000010,%00000010 'and re=issue the interrupt command
return
first:
'de-bounce the switch
'DO SOMETHING
goto main
second:
'de-bounce the switch
'DO SOMETHING
goto main
three:
'de-bounce the switch
'DO SOMETHING
goto main