Copyright © Parallax Inc.
Infrared Line Follower Kit (#28034)
v1.0 1/18/2011 Page 8 of 9
Calibration
Different lighting conditions, mounting positions or changes in temperature may require different
frequency settings. For this reason, the Infrared Line Follower has a user selectable infrared frequency
range of 38-43 kHz using an onboard potentiometer. If you are having problems reading a line when
running the test code, place all IR detectors over a black surface and gently adjust the onboard
potentiometer until all eight red LEDs are off.
Note:
A small flathead screwdriver is required to adjust the frequency range. The Parallax screwdriver
included in the Boe-Bot and Stingray robot kits is usually sufficient.
Boe-Bot Robot Line Following Code
The code below can be used for simple Boe-Bot line following applications, and is compatible with the
circuit shown in Figure 1. Keep in mind that this is not the most robust line following code, which can and
should be expanded to better fit your needs.
' InfraredLineFollower_BoeBot.bs2
' Simple line following Boe-Bot code using the Infrared Line Follower.
' {$STAMP BS2}
' {$PBASIC 2.5}
DO
SELECT INL ' Select line follower states
CASE %11000000, %11100000 ' Pivot right
PULSOUT 13, 650
PULSOUT 12, 650
CASE %01100000, %01110000 ' Curve right
PULSOUT 13, 700
PULSOUT 12, 650
CASE %00110000 ' Slight right
PULSOUT 13, 750
PULSOUT 12, 650
CASE %00111000 ' Adjust right
PULSOUT 13, 800
PULSOUT 12, 650
CASE %00011000 ' Straight
PULSOUT 13, 850
PULSOUT 12, 650
CASE %00011100 ' Adjust left
PULSOUT 13, 850
PULSOUT 12, 700
CASE %00001100 ' Slight left
PULSOUT 13, 850
PULSOUT 12, 750
CASE %00000110, %00001110 ' Curve left
PULSOUT 13, 850
PULSOUT 12, 800
CASE %00000011, %00000111 ' Pivot left
PULSOUT 13, 850
PULSOUT 12, 850
ENDSELECT
LOOP