Parallax Boe-Bot Student Manual page 288

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

Advertisement

Page 274 · Robotics with the Boe-Bot
' -----[ Variables ]----------------------------------------------------------
freqSelect
VAR
irFrequency
VAR
irDetect
VAR
distance
VAR
' -----[ Initialization ]-----------------------------------------------------
DEBUG CLS,
"
OBJECT", CR,
"FREQUENCY
DETECTED", CR,
"---------
--------"
' -----[ Main Routine ]-------------------------------------------------------
DO
distance = 0
FOR freqSelect = 0 TO 4
LOOKUP freqSelect,[37500,38250,39500,40500,41500], irFrequency
FREQOUT 8,1, irFrequency
irDetect = IN9
distance = distance + irDetect
DEBUG CRSRXY, 4, (freqSelect + 3), DEC5 irFrequency
DEBUG CRSRXY, 11, freqSelect + 3
IF (irDetect = 0) THEN DEBUG "Yes" ELSE DEBUG "No "
PAUSE 100
NEXT
DEBUG CR,
"---------
--------", CR,
"Zone
", DEC1 distance
LOOP
Your Turn – Testing the Right IR LED/Detector Pair
Although there's some labeling involved, you can modify this program to test the right IR
LED and detector by changing these two lines:
FREQOUT 8,1, irFrequency
irDetect = IN9
Nib
Word
Bit
Nib

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