28125 Parallax Inc, 28125 Datasheet - Page 290

TEXT ROBOTICS

28125

Manufacturer Part Number
28125
Description
TEXT ROBOTICS
Manufacturer
Parallax Inc
Datasheet

Specifications of 28125

Title
Robotics with the Boe-Bot
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
DO
LOOP
' -----[ Subroutine – Get_Distances ]-----------------------------------------
Get_Distances:
' -----[ Subroutine – Display_Distances ]-------------------------------------
Display_Distances:
Your Turn – More Distance Tests
GOSUB Get_Distances
GOSUB Display_Distances
distanceLeft = 0
distanceRight = 0
FOR freqSelect = 0 TO 4
NEXT
RETURN
DEBUG CRSRXY,2,3, DEC1 distanceLeft,
RETURN
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
PAUSE 100
Try measuring the distance of different objects and find out if the color and/or
texture make any difference to the distance measurement.
CRSRXY,9,3, DEC1 distanceRight

Related parts for 28125