main:
readadc 1,b1
readadc 2,b2
select case b1
case 0 to 80
high 3
case 80 to 155
low 3
endselect
select case b2
case 0 to 100
high 1
case 80 to 155
low 1
endselect
goto main
-------------------------------------------
simple program to allow the buggy to follow a certain path. When one of the sensors drifts off to white surface the wheel on that side will stop, until sensor is back on black line.
problems to be expected would be caused by program delay to detect change in input and change output accordingly. This will cause buggy to zig zag along the line.
things that will need changing are values for the case statements. Currently we are testing using a potentiometer till we find a suitable resistance to go with the LDR's.
Thursday, 25 March 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment