TestLeftFrequencySweep

TestLeftFrequencySweep - "--------- --------" '...

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

View Full Document Right Arrow Icon
' -----[ Title ]-------------------------------------------------------------- ' Robotics with the Boe-Bot - TestLeftFrequencySweep.bs2 ' Test IR detector distance responses to frequency sweep. ' ' {$STAMP BS2} ' Stamp directive. ' {$PBASIC 2.5} ' PBASIC directive. ' ' -----[ Variables ]---------------------------------------------------------- ' freqSelect VAR Nib irFrequency VAR Word irDetect VAR Bit distance VAR Nib d ' -----[ Initialization ]----------------------------------------------------- ' DEBUG CLS, " OBJECT", CR, "FREQUENCY DETECTED", CR,
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: "--------- --------" ' -----[ Main Routine ]-------------------------------------------------------' DO D 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, "Distance ", DEC1 distance LOOP...
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