Parallax Boe-Bot Student Manual page 268

Hide thumbs Also See for Boe-Bot:
Table of Contents

Advertisement

Page 254 · Robotics with the Boe-Bot
command's worth of time, the IR detector will return to the not detected (1 state),
regardless of whether or not it detected an object.
FREQOUT 8, 1, 38500
irDetectLeft = IN9
FREQOUT 2, 1, 38500
irDetectRight = IN0
In the
statements, instead of delivering pulses or calling navigation routines,
IF...THEN
this program sets variable values that will be used in
arguments.
IF (irDetectLeft = 0) AND (irDetectRight = 0) THEN
pulseLeft = 650
pulseRight = 850
ELSEIF (irDetectLeft = 0) THEN
pulseLeft = 850
pulseRight = 850
ELSEIF (irDetectRight = 0) THEN
pulseLeft = 650
pulseRight = 650
ELSE
pulseLeft = 850
pulseRight = 650
ENDIF
Before the
repeats, the last thing to do is to deliver pulses to the servos. Notice
DO...LOOP
that the
command is no longer 20. Instead, it's 15 since roughly 5 ms is taken
PAUSE
checking the IR LEDs.
PULSOUT 13,pulseLeft
PULSOUT 12,pulseRight
PAUSE 15
Your Turn
Save FastIrRoaming.bs2 as FastIrRoamingYourTurn.bs2.
Use the LEDs to broadcast that the Boe-Bot has detected an object.
Try modifying the values that pulseLeft and pulseRight are set to so that the
Boe-Bot does everything at half speed.
commands'
PULSOUT
Duration
' Apply the pulse.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Boe-Bot and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF