Hey, trying to get this program to work for the IRPD. It has been made off of the sample program from Lynxmotion’s IRPD Manual to test it with a micro controller. I’m having it give off a tone when something is there since I do not have a robot to work with. But the problem I have is that ‘templ’ and ‘tempr’ always equal 1, both when there is something there and when something is not. It sets to zero at the beginning so sometime before it goes through the ‘If’ commands it resets it to one. Any help would be much appreciated.
'IRPD test Program
templ var bit
tempr var bit
action var nib
pause 1000 'let IRPD settle
start:
templ = 0
tempr = 0
action = 0
high 8 :
pause 1000
templ = in12
low 8
high 15 :
pause 1000
tempr = in12
low 15
cont1:
if templ = 0 then
action = action
pause 1000
else 'object on left
action = action + 1
pause 1000
endif
pause 1000
cont2:
if tempr = 0 then
action = action
pause 1000
else
action = action + 2
pause 1000
endif
pause 1000
cont3:
'action = 0, nothing in the way
'action = 1, something on front left side
'action = 2, something on front right side
'action = 3, something in front
branch action, forward, turn_r, turn_l, backup ]
forward:
pause 1000
goto start
turn_r:
sound 9, 150\2500 ]
pause 1000
goto start
turn_l:
sound 9, 150\3000 ]
pause 1000
goto start
backup:
sound 9, 150\3500 ]
pause 1000
goto start