Download Print this page

Parallax 29115 Manual page 16

Line follower module

Advertisement

Listing 3
' -----[ Title ]----------------------------------------------------------------
'
' File...... LF_CONTEST.BS2
' Purpose... Line Follower contest code
' Author.... Parallax
' E-mail.... stamptech@parallaxinc.com
' { $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
RMotor
CON
' -----[ Constants ]------------------------------------------------------------
'
LEDon
CON
LEDoff
CON
WLine
CON
BLine
CON
LFmode
CON
MStop
CON
Speed100
CON
Speed075
CON
Speed050
CON
Yes
CON
No
CON
' -----[ Variables ]------------------------------------------------------------
'
temp
VAR
ledPos
VAR
lfBits
VAR
lastBits
VAR
steer
VAR
onCourse
VAR
' -----[ EEPROM Data ]----------------------------------------------------------
'
RstValue
DATA
Parallax, Inc. • Parallax Line Follower (#29115) • 12/2001
15
14
0
1
0
1
BLine
750
125
50
40
1
0
Byte
Nib
Byte
Byte
Nib
Bit
$FF
' servo motor connections
' LF LEDs are active low
' white line on black field
' black line on white field
' set for black line
' motor stop
' full speed
' three-quarter speed
' half speed
' LED position in lfBits
' line follower input bits
' last LF input
' steering control
' on course flag
' $FF = no run
Page 15

Advertisement

loading