Kushal.
First, read Manual 2 page 146 (setint)
I've used Arvin's ideas and added your flashing light code.
On my test set-up, I added an LED on output 0 and also added the SERTXD command.
You'll need to change the lines I've marked with *****
Code:
#picaxe 28x
setint %00000000,%00000001 ' low on pin0
swon61:
high 6
low 5
low 7
pause 30
low 6
pause 30
goto swon61
interrupt:
infrain
pause 500
' Put your own code here ********
sertxd (cr,lf,"you pressed key ", #infra,cr,lf) '***
high 0 : pause 500 : low 0 '***
setint %00000000,%00000001
return
In Arvin's program, ANY infrain command makes pin 0 low.
(There's a knock at the door.)
Interrupt : (You stop what you're doing.)
Infrain: (You read the message.)
If infra = ........... You do something with the message.
Return: you go back to to the lights.
(Thanks to Hippy for the concepts.)
e.