Parallax Boe-Bot Student Manual page 205

Hide thumbs Also See for Boe-Bot:
Table of Contents

Advertisement

To modify the
Main
condition with this single line:
IF
GOSUB Turn_Away
P1. The key to solving this problem is to write a statement that makes a beep with
the required parameters:
FREQOUT 4, 100, 4000
This statement must be added to the Main Routine in the appropriate places, as
shown below. The rest of the program is unchanged.
' -----[ Main Routine ]----------------------------------------
DO
IF (IN5
= 0) AND (IN7 = 0) THEN
FREQOUT 4, 100, 4000
FREQOUT 4, 100, 4000
GOSUB Back_Up
GOSUB Turn_Left
GOSUB Turn_Left
ELSEIF (IN5
= 0) THEN
FREQOUT 4, 100, 4000
GOSUB Back_Up
GOSUB Turn_Right
ELSEIF (IN7
= 0) THEN
FREQOUT 4, 100, 4000
GOSUB Back_Up
GOSUB Turn_Left
ELSE
GOSUB Forward_Pulse
ENDIF
LOOP
P2. We found from Chapter 4 Projects that a 1 yard circle can be achieved with
PULSOUT 13, 850
the radius can be adjusted by slightly increasing or decreasing the pulse width
from the starting value of 716. Each time a whisker is pressed the program will
add or subtract a bit from the right wheel's pulse width.
In the solution below, an audible beeping indicator was added. This acts as
feedback to verify that the whisker was pressed. This is entirely optional.
Chapter 5: Tactile Navigation with Whiskers · Page 191
Routine, replace the three
and
. Using these values as the 1y circle,
PULSOUT 12, 716
commands under the first
GOSUB
' 4kHz beep for 100ms
' Both whiskers detect
' 4 kHz beep for 100 ms
'
Repeat twice
' Back up & U-turn
' Left whisker contacts
' 4 kHz beep for 100 ms
' Back up & turn right
' Right whisker contacts
' 4 kHz beep for 100 ms
' Back up & turn left
' Both whiskers 1, no
' contacts
' Apply a forward pulse
' and check again

Advertisement

Table of Contents
loading

Table of Contents