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 #297 background imageLoading...
Page #297 background image
Chapter 8: Robot Control with Distance Detection · Page 283
Get_Ir_Distances:
distanceLeft = 0
distanceRight = 0
FOR freqSelect = 0 TO 4
LOOKUP freqSelect,[37500,38250,39500,40500,41500], irFrequency
FREQOUT 8,1,irFrequency
irDetectLeft = IN9
distanceLeft = distanceLeft + irDetectLeft
FREQOUT 2,1,irFrequency
irDetectRight = IN0
distanceRight = distanceRight + irDetectRight
NEXT
RETURN
' -----[ Subroutine – Get Pulse ]---------------------------------------------
Send_Pulse:
PULSOUT 13,pulseLeft
PULSOUT 12,pulseRight
PAUSE 5
RETURN
How the FollowingBoeBot.bs2 Works
FollowingBoeBot.bs2 declares four constants,
Kpr, Kpl, SetPoint, and CenterPulse
using the
CON directive. Everywhere you see SetPoint, it’s actually the number 2 (a
constant). Likewise, everywhere you see either
Kpl, it’s actually the number -35. Kpr is
actually 35, and
CenterPulse is 750.
Kpl CON -35
Kpr CON 35
SetPoint CON 2
CenterPulse CON 750
The first thing the main routine does is call the Get_Ir_Distances subroutine. After the
Get_Ir_Distances subroutine is finished, distanceLeft and distanceRight each
contain a number corresponding to the zone in which an object was detected for both the
left and right IR pairs.
DO
GOSUB Get_Ir_Distances

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