DisplayBothDistances

DisplayBothDistances - ' DO D GOSUB Get_Distances GOSUB...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
' -----[ Title ]-------------------------------------------------------------- ' Robotics with the Boe-Bot - DisplayBothDistances.bs2 ' Test IR detector distance responses of both IR LED/detector pairs to ' frequency sweep. ' ' {$STAMP BS2} ' Stamp directive. ' {$PBASIC 2.5} ' PBASIC directive. ' ' -----[ Variables ]---------------------------------------------------------- ' freqSelect VAR Nib irFrequency VAR Word irDetectLeft VAR Bit irDetectRight VAR Bit distanceLeft VAR Nib distanceRight VAR Nib d ' -----[ Initialization ]----------------------------------------------------- ' DEBUG CLS, "IR OBJECT ZONE", CR, "Left Right", CR, "----- -----" ' -----[ Main Routine ]-------------------------------------------------------
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ' DO D GOSUB Get_Distances GOSUB Display_Distances LOOP L ' -----[ Subroutine - Get Distances ]-----------------------------------------' Get_Distances: G 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 PAUSE 100 NEXT RETURN ' -----[ Subroutine - Display Distances ]-------------------------------------' Display_Distances: D DEBUG CRSRXY,2,3, DEC1 distanceLeft, CRSRXY,9,3, DEC1 distanceRight RETURN...
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.

Page1 / 2

DisplayBothDistances - ' DO D GOSUB Get_Distances GOSUB...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online