I have 2 infrared sensors that are in opposite directions.
The program has a "Main" Loop which when interrupted by a certain Sony Remote Code should light a red or green led
to show which ir sensor received the ir signal.
Only the red led will light see code "flashred...." when ir received on ir sensor connected to pin4.
When ir is transmitted from opposite side, the green led will not light; ir should be received and pin3 do this.
I have checked this with irin pin3 only with another program: NOT using INTERRUPT and ir into sensor on pin 3 only ( no irin on pin 4 ect. ) and ir received
on sensor and pin3 go's high and green led lights.
Therefore I must conclude it is not in circuit but something in code.
I will appreciate any advice on this . It is probably something very simple
and I not seeing forest thru trees!
The code:
' TEST 2 IR INTERRUPT's
' 12-16-2015
' See page 69 of Manual "Getting
' Started" Section 1
symbol reccode = b0
setint %00000000, %00011000
main:
pause 100
high 5
low 4
pause 500
goto main
interrupt:
CKA:
irin[1000,CKB],4,reccode
pause 100
if reccode = 2 then flashred
CKB:
irin[1000,interdone],3,reccode
pause 100
if reccode = 2 then flashgreen
interdone:
setint %00000000, %00011000
return
flashred:
low 5
high 4
pause 2000
low 4
pause 200
goto interdone
flashgreen:
high 4
pause 500
low 4
high 5
pause 2000
low 5
pause 200
goto interdone
The program has a "Main" Loop which when interrupted by a certain Sony Remote Code should light a red or green led
to show which ir sensor received the ir signal.
Only the red led will light see code "flashred...." when ir received on ir sensor connected to pin4.
When ir is transmitted from opposite side, the green led will not light; ir should be received and pin3 do this.
I have checked this with irin pin3 only with another program: NOT using INTERRUPT and ir into sensor on pin 3 only ( no irin on pin 4 ect. ) and ir received
on sensor and pin3 go's high and green led lights.
Therefore I must conclude it is not in circuit but something in code.
I will appreciate any advice on this . It is probably something very simple
and I not seeing forest thru trees!
The code:
' TEST 2 IR INTERRUPT's
' 12-16-2015
' See page 69 of Manual "Getting
' Started" Section 1
symbol reccode = b0
setint %00000000, %00011000
main:
pause 100
high 5
low 4
pause 500
goto main
interrupt:
CKA:
irin[1000,CKB],4,reccode
pause 100
if reccode = 2 then flashred
CKB:
irin[1000,interdone],3,reccode
pause 100
if reccode = 2 then flashgreen
interdone:
setint %00000000, %00011000
return
flashred:
low 5
high 4
pause 2000
low 4
pause 200
goto interdone
flashgreen:
high 4
pause 500
low 4
high 5
pause 2000
low 5
pause 200
goto interdone