Let's Make Robots!

IR tracking

Sharp IR tracking code

I'm trying to get a Sharp IR sensor on a servo to track the left edge of an object, i came up with this code:

symbol detection = 50

main:
readadc 4, b1
if b1 > detection then
goto servoleft
else
goto servoright
end if
goto main

servoleft:
servo 3, 100
return

servoright:
servo 3, 200
return