Trouble with sensor communicating to bot board

:smiley:

Anybody have any idea about the language needed for the single line detector sensor to communicate to an atom board? I have the engines communicating through their pins…now the sensors. The sensors are running into the 4th and 5th pin.

Some attempts:

getpulse:
S1_data=0;
S2_data=0;
pulsin 4,1,S1_data
pulsin 5,1,S2_data
if S1_data>0 then goto myend
if S2_data>0 then goto myend
return

end

and (—from the old programs list—)

x var byte
y var byte
left var byte
right var byte
lstop con 150
rstop con 150
left = lstop
right = rstop
lmax con lstop +10
rmax con rstop +10
lmin con lstop -10
rmin con rstop -10

start:
if in4=1 then skip1
left = lmax
right = rmax
gosub p_out
skip1:
if in5 = 1 then skip2
left = lmax
right = rmin
gosub p_out
skip2
if in13 = 1 then skip3
left = lmin
right = rmax
gosub p_out
skip3:
gosub p_out
goto start

p_out:
pulsout 0, (left * 5)
Pulsout 1, (right * 5)
pause 20
return

My bot board has tons to share with the sensors, so i really need to figure this out for them! :laughing:

Gracias,

Brian

No you want to use the status of the pin h or l, not a pulsin command.

variable1 = in4 if variable1 = 1 then bla bla if variable1 - 0 then bla bla

Thios may work as well. But I don’t have time to test it.

if in4 = 1 then bla bla if in4 = 0 then bla bla