EscapingCorners

EscapingCorners - ' -[ Title ]-' Robotics with the Boe-Bot -

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 - EscapingCorners.bs2 ' Boe-Bot navigates out of corners by detecting alternating whisker presses. ' ' {$STAMP BS2} ' Stamp directive. ' {$PBASIC 2.5} ' PBASIC directive. ' ' -----[ Variables ]---------------------------------------------------------- ' pulseCount VAR Byte ' For. ..next loop counter. counter VAR Nib ' Counts alternate contacts. old7 VAR Bit ' Stores previous IN7. old5 VAR Bit ' Stores previous IN5. o ' -----[ Initialization ]----------------------------------------------------- ' FREQOUT 4, 2000, 3000 ' Signal program start/reset. counter = 1 ' Start alternate corner count. old7 = 0 ' Make up old values. old5 = 1 o ' -----[ Main Routine ]------------------------------------------------------- ' DO D ' --- Detect Consecutive Alternate Corners ------------------------ ' See the "How EscapingCorners.bs2 Works" section that follows this program. ' IF (IN7 <> IN5) THEN ' One or other is pressed. IF (Old7 <> IN7) AND (Old5 <> IN5) THEN
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the 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

EscapingCorners - ' -[ Title ]-' Robotics with the Boe-Bot -

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