Parallax Boe-Bot Student Manual page 282

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

Advertisement

Page 268 · Robotics with the Boe-Bot
' -----[ Subroutines ] ------------------------------------------------
Sniff:
IF (IN0 = 0) OR (IN9 = 0) THEN
FOR counter = 1 TO 5
HIGH 1
HIGH 10
FREQOUT 4, 50, 4000
LOW 1
LOW 10
PAUSE 20
NEXT
ENDIF
RETURN
Roam:
FREQOUT 8, 1, 38500
irDetectLeft = IN9
FREQOUT 2, 1, 38500
irDetectRight = IN0
IF (irDetectLeft = 0) AND (irDetectRight = 0) THEN
pulseLeft = 650
pulseRight = 850
ELSEIF (irDetectLeft = 0) THEN
pulseLeft = 850
pulseRight = 850
ELSEIF (irDetectRight = 0) THEN
pulseLeft = 650
pulseRight = 650
ELSE
pulseLeft = 850
pulseRight = 650
ENDIF
PULSOUT 13,pulseLeft
PULSOUT 12,pulseRight
PAUSE 15
RETURN
' From IrInterferenceSniffer.bs2
' Beep 5 times
' and flash LEDs
' From FastIrRoaming.bs2
' Check IR Detectors
' Decide how to navigate.
' Apply the pulse.

Advertisement

Table of Contents
loading

Table of Contents