EasyManuals Logo

Parallax Boe-Bot User Manual

Parallax Boe-Bot
360 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #273 background imageLoading...
Page #273 background image
Chapter 7: Navigating with Infrared Headlights · Page 259
FREQOUT 4, 2000, 3000 ' Signal program start/reset.
DO ' Main Routine.
FREQOUT 8, 1, 38500 ' Check IR detectors.
irDetectLeft = IN9
FREQOUT 2, 1, 38500
irDetectRight = IN0
' Decide navigation.
IF (irDetectLeft = 0) AND (irDetectRight = 0) THEN
pulseCount = 1 ' Both detected,
pulseLeft = 850 ' one pulse forward.
pulseRight = 650
ELSEIF (irDetectRight = 1) THEN ' Right not detected,
pulseCount = 10 ' 10 pulses left.
pulseLeft = 650
pulseRight = 650
ELSEIF (irDetectLeft = 1) THEN ' Left not detected,
pulseCount = 10 ' 10 pulses right.
pulseLeft = 850
pulseRight = 850
ELSE ' Neither detected,
pulseCount = 15 ' back up and try again.
pulseLeft = 650
pulseRight = 850
ENDIF
FOR loopCount = 1 TO pulseCount ' Send pulseCount pulses
PULSOUT 13,pulseLeft
PULSOUT 12,pulseRight
PAUSE 20
NEXT
LOOP
How AvoidTableEdge.bs2 Works
Since this program is a modified version of FastIrRoaming.bs2, only changes to the program
are discussed here.
A FOR…NEXT loop is added to the program to control how many pulses are delivered each
time through the main (
DO…LOOP) routine. Two variables are added, loopCount
functions as an index for a
FOR…NEXT loop and pulseCount is used as the EndValue
argument.
loopCount VAR Byte

Table of Contents

Other manuals for Parallax Boe-Bot

Questions and Answers:

Question and Answer IconNeed help?

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

Parallax Boe-Bot Specifications

General IconGeneral
BrandParallax
ModelBoe-Bot
CategoryRobotics
LanguageEnglish