.
BS22
Posts: 3
Hello.
Post Edited (BS22) : 7/20/2005 6:05:23 PM GMT
Post Edited (BS22) : 7/20/2005 6:05:23 PM GMT
Comments
locate either Sensors or Motors.
It appears to me that what you have offered as "part of the source code" may be a merging of multiple programs, which when taken together, do not work. The reason I say that may be found below in this program that I downloaded from the Lynxmotion web site. It looks remarkably similar to part of the program in your posting:
' Program LINETRK.BS2
' Simple Line Tracking
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 in15 = 1 then skip1
left = lmax
right = rmax
gosub p_out
skip1:
if in14 = 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
This may have originally been a Parallax Demsonstration program, I really couldn't say. I've no idea where the other parts of your program came from, but that code (above) will provide a simple line tracking function, if the wiring of the motors and sensors matches the program requirements. Although I have no method to actually test it, I suspect it works as is.
That being offered, let's see if we can go from here.
Regards,
Bruce Bates