FastIrRoaming

FastIrRoaming - ' Decide how to navigate. IF (irDetectLeft...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
' Robotics with the Boe-Bot - FastIrRoaming.bs2 ' Higher performance IR object detection assisted navigation ' ' {$STAMP BS2} ' {$PBASIC 2.5} ' irDetectLeft VAR Bit ' Variable Declarations irDetectRight VAR Bit pulseLeft VAR Word pulseRight VAR Word p FREQOUT 4, 2000, 3000 ' Signal program start/reset. F DO ' Main Routine D FREQOUT 8, 1, 38500 ' Check IR Detectors irDetectLeft = IN9 FREQOUT 2, 1, 38500 irDetectRight = IN0
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ' Decide how to navigate. 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 ' Apply the pulse. PULSOUT 12,pulseRight PAUSE 15 LOOP ' Repeat main routine...
View Full Document

This note was uploaded on 04/23/2010 for the course EECC 0306-201 taught by Professor Roymelton during the Spring '10 term at RIT.

Ask a homework question - tutors are online