
Parallax, Inc. • Parallax Line Follower (#29115) • 12/2001
Page 15
Listing 3
' -----[ Title ]----------------------------------------------------------------
'
' File...... LF_CONTEST.BS2
' Purpose... Line Follower contest code
' Author.... Parallax
' E-mail.... [email protected]
' { $STAMP BS2 }
' -----[ Program Description ]--------------------------------------------------
'
' This program is designed to run line follower contests where the BOE-Bot will
' start and stop on a "T" in the track. It implements a controlled start feature
' using the BOE Reset button. Pressing the Reset button starts the BOE-Bot.
' -----[ Revision History ]-----------------------------------------------------
'
' 01 DEC 2001 - Version 1.0
' -----[ I/O Definitions ]------------------------------------------------------
'
LMotor CON 15 ' servo motor connections
RMotor CON 14
' -----[ Constants ]------------------------------------------------------------
'
LEDon CON 0 ' LF LEDs are active low
LEDoff CON 1
WLine CON 0 ' white line on black field
BLine CON 1 ' black line on white field
LFmode CON BLine ' set for black line
MStop CON 750 ' motor stop
Speed100 CON 125 ' full speed
Speed075 CON 50 ' three-quarter speed
Speed050 CON 40 ' half speed
Yes CON 1
No CON 0
' -----[ Variables ]------------------------------------------------------------
'
temp VAR Byte
ledPos VAR Nib ' LED position in lfBits
lfBits VAR Byte ' line follower input bits
lastBits VAR Byte ' last LF input
steer VAR Nib ' steering control
onCourse VAR Bit ' on course flag
' -----[ EEPROM Data ]----------------------------------------------------------
'
RstValue DATA $FF ' $FF = no run