28108 Parallax Inc, 28108 Datasheet - Page 6

KIT QTI BOE-BOT LINE FOLLOWER

28108

Manufacturer Part Number
28108
Description
KIT QTI BOE-BOT LINE FOLLOWER
Manufacturer
Parallax Inc
Datasheet

Specifications of 28108

Accessory Type
QTI Infrared
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
Boe-Bot®
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Copyright © Parallax Inc.
' {$STAMP BS2}
' {$PBASIC 2.5}
' LineFollowWithCheckQtis.bs2
' Navigates based on values acquired with the
' Check_Qtis subroutine.
qtis VAR Nib
OUTB = %1111
DO
LOOP
Check_Qtis:
' Result -> qtis variable.
' 0 means white surface
' 1 means black surface.
GOSUB Check_Qtis
SELECT qtis
ENDSELECT
DIRB = %1111
PAUSE 0
DIRB = %0000
PAUSE 0
qtis = INB
RETURN
CASE %1000
CASE %1100
CASE %0100
CASE %0110
CASE %0010
CASE %0011
CASE %0001
CASE ELSE
PULSOUT 13, 650
PULSOUT 12, 650
PULSOUT 13, 750
PULSOUT 12, 650
PULSOUT 13, 800
PULSOUT 12, 650
PULSOUT 13, 850
PULSOUT 12, 650
PULSOUT 13, 850
PULSOUT 12, 700
PULSOUT 13, 850
PULSOUT 12, 750
PULSOUT 13, 850
PULSOUT 12, 850
PAUSE 3
' black/white states
' Set OUTB bits to 1
' Main DO...LOOP
' Get QTI states
' Control servo
' speeds/directions
' Rotate right
' Pivot right
' Curve right
' Straight ahead
' Curve left
' Pivot left
' Rotate left
' Do nothing
' P7..P4 -> output
' Delay = 230 us
' P7..P4 -> input
' Delay = 230 us
' Store QTI outputs
' in INB
QTI LIne Follower AppKit (#28108)
Keep in mind that this is a bare-bones line
following example. Making it robust and
versatile is up to you. The Boe-Bot starts
maneuvers when it sees one of the cases
listed in the SELECT...CASE statement.
This
demonstration program because the Boe-
Bot doesn't go anywhere when it is on an
all white or all black surface. It only starts
navigation when it detects a line. You can
add extra code, especially in the form of
CASE statements to deal with special
situations and more complex courses.
is
Try other courses to test the limits
of the program.
Try modifying the program to
solve courses that the unmodified
program could not solve.
Modify the program so that it
smoothes out the Boe-Bot's
responses to changes in the line's
direction. Your code should take
steps toward a maximum speed
each time it detects that a given
pattern is detected.
Detect intersections and make
random turns.
Challenge a friend, or set up a
Boe-Bot line following
competition.
convenient
v2.0 3/23/2009 Page 6 of 6
for
a
simple

Related parts for 28108