' {$STAMP BS2} ' {$PBASIC 2.5} 'Navigate with Feelers Navigate: counter VAR Word DO IF (IN12 = 1) THEN ‘IN12 is a button, it equals 0 when pressed PAUSE 1 ELSE PAUSE 2000 DO IF (IN7 = 0) THEN FOR counter = 1 TO 25 ‘Reverses Boebot PULSOUT 12, 650 PULSOUT 13, 850 PAUSE 20 NEXT FOR counter = 1 TO 12 ‘Turns Boebot PULSOUT 12, 650 PULSOUT 13, 650 PAUSE 20 NEXT ELSEIF (IN5 = 0) THEN FOR counter = 1 TO 25 ‘reverses Boebot PULSOUT 12, 650 PULSOUT 13, 850 PAUSE 20 NEXT FOR counter = 1 TO 12 ‘turns Boebot PULSOUT 12, 850 PULSOUT 13, 850 PAUSE 20 NEXT ELSEIF (IN12 = 0) THEN ‘Supposed to return to start of program when button is pressed again PAUSE 1000 GOTO Navigate ELSE PULSOUT 12, 850 ‘Drives forward PULSOUT 13, 650 PAUSE 20 ENDIF LOOP ENDIF LOOP