Parallax Boe-Bot Student Manual page 314

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

Advertisement

Page 300 · Robotics with the Boe-Bot
PULSOUT 12, 750
PAUSE 20
RETURN
Get_Ir_Distances:
' Read both IR pairs and calculate the distance.
' reading.
White surface give 0-1 reading.
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
Send_Pulse:
' Send a single pulse to the servos in between IR readings.
PULSOUT 13,pulseLeft
PULSOUT 12,pulseRight
PAUSE 5
RETURN
P2. If you create an interesting Boe-Bot maze project and you want to share it with
others, you may want to join the StampsInClass Yahoo! Group, listed behind the
title page of Robotics with the Boe-Bot. Or, you can email the parallax
Educational Team directly at stampsinclass@parallax.com.
Black line gives 4-5
' PAUSE reduced due to IR readings

Advertisement

Table of Contents
loading

Table of Contents