Chapter 8: Robot Control with Distance Detection · Page 291
√ Change Kpr from 35 to -35.
√ Run the program (shown below).
√ Place your Boe-Bot at the “Start” location shown in Figure 8-13. The Boe-Bot
should wait there until you place your hand in front of its IR pairs. It will then
roll forward. When it clears the starting stripe, take your hand away, and it
should start tracking the stripe. When it sees the “Finish” stripe, it should stop
and wait there.
√ Assuming that you can get distance readings of 5 from the electrical tape and 0
from the poster board,
SetPoint constant values of 2, 3, and 4 should work.
Try different
SetPoint values and make notes of your Boe-Bot’s performance
on the track.
28” (71 cm)
22” (56 cm)
www.stampsinclass.com
Reset
S
T
A
M
P
S
C
L
A
S
S
in
Board of Education
Pwr
9 Vdc
Battery
6-9VDC
Sout
Sin
ATN
Vss
P0
P1
P2
P3
P4
P5
P6
P7
P11
P9
P8
Vin
P10
P15
P14
P13
P12
Vdd
Rst
Vss
Bla c k
Red
X4 X5
15 14 13 12
1
X1
Vss
P1
P3
P5
P7
P9
P11
P13
P15
Vin
Vss
P0
P2
P4
P6
P8
P10
P12
P14
Vdd
U1
TM
0 1 2
© 2000-2 003
Vdd
P15
P14
P13
P12
P11
P10
P9
P8
P7
P6
P5
P4
P3
P2
P1
P0
X2
X3
Vdd VssVin
P15
P14
P13
P12
P11
P10
P9
P8
P4
P2
P1
P0
P7
P6
P5
P3
X2
X3
Vdd VssVin
Rev C
+
www.s tam ps in cl a ss. c om
Reset
S
T
A
M
P
S
C
L
A
S
S
i
n
Board of Education
Pwr
9 Vd c
Battery
6-9V DC
Sout
Sin
ATN
Vss
P0
P1
P2
P3
P4
P5
P6
P7
P11
P9
P8
Vin
P10
P15
P14
P13
P12
Vdd
Rst
Vss
Black
Red
X4 X5
15 14 13 12
1
X1
Vss
P1
P3
P5
P7
P9
P11
P13
P15
Vin
Vs s
P0
P2
P4
P6
P8
P1 0
P1 2
P1 4
Vd d
U1
TM
0 1 2
© 200 0-200 3
Vdd
P15
P14
P13
P12
P11
P10
P9
P8
P7
P6
P5
P4
P3
P2
P1
P0
X2
X3
Vdd VssVin
P1 5
P1 4
P1 3
P1 2
P1 1
P1 0
P9
P8
P4
P2
P1
P0
P7
P6
P5
P3
X2
X3
Vdd VssVin
Rev C
+
Start
Finish
Figure 8-13
Stripe
Following
Course
' -----[ Title ]--------------------------------------------------------------
' Robotics with the Boe-Bot - StripeFollowingBoeBot.bs2
' Boe-Bot adjusts its position to move toward objects that are closer than
' zone 3 and away from objects further than zone 3. Useful for following a
' 2.25 inch wide vinyl electrical tape stripe.
' {$STAMP BS2} ' Stamp directive.
' {$PBASIC 2.5} ' PBASIC directive.
DEBUG "Program Running!"
' -----[ Constants ]----------------------------------------------------------
Kpl CON 35 ' Change from -35 to 35