I have a 18X chip and i want to count the pulses per minute. It should be in the range on about 20 per minute. The problem is, the main loop seems to be not running. I started with the code from the manual SETINT section.
I think I should see this
X.....Count=1
.........Count=2
..Count=3
But nothing inside the loop.
I see this
XCount=1
Count=2
Count=3
It is if the code execution halts at the setint commands until the interupt occurs. Is this the case?
I think I should see this
X.....Count=1
.........Count=2
..Count=3
But nothing inside the loop.
I see this
XCount=1
Count=2
Count=3
It is if the code execution halts at the setint commands until the interupt occurs. Is this the case?
Code:
#PICAXE 18X
#terminal 4800
#no_data
'Pin 1 connected to pulse input to be counted,
'about 20 pulses per second
'Pin 3 connected to LED, flash each time a pulse is counted
goto example
Example:
sertxd("X")
setint %00000010,%00000010
; activate interrupt when pin1 only goes high
do
' B1=0
sertxd(".")
pause 1000
loop
sertxd("x")
interrupt:
high 3 'flash the LED
inc B1
sertxd("Count=",#B1,cr,lf)
low 3
do
loop until pin1 <> 1 'loop here until the interrupt cleared
setint %00000010,%00000010
return