28125 Parallax Inc, 28125 Datasheet - Page 205

TEXT ROBOTICS

28125

Manufacturer Part Number
28125
Description
TEXT ROBOTICS
Manufacturer
Parallax Inc
Datasheet

Specifications of 28125

Title
Robotics with the Boe-Bot
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
P1. The key to solving this problem is to write a statement that makes a beep with
P2. We found from Chapter 4 Projects that a 1 yard circle can be achieved with
To modify the
IF
the required parameters:
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
GOSUB Turn_Left
LOOP
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.
IF (IN5
ELSEIF (IN5
ELSEIF (IN7
ELSE
ENDIF
condition with this single line:
GOSUB Turn_Away
FREQOUT 4, 100, 4000
FREQOUT 4, 100, 4000
GOSUB Back_Up
GOSUB Turn_Left
FREQOUT 4, 100, 4000
GOSUB Back_Up
GOSUB Turn_Right
FREQOUT 4, 100, 4000
GOSUB Back_Up
GOSUB Turn_Left
GOSUB Forward_Pulse
FREQOUT 4, 100, 4000
= 0) AND (IN7 = 0) THEN
Main
= 0) THEN
= 0) THEN
and
Routine, replace the three
PULSOUT 12, 716
. Using these values as the 1y circle,
' 4kHz beep for 100ms
' Both whiskers detect
' 4 kHz beep for 100 ms
'
' 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
GOSUB
Repeat twice
commands under the first

Related parts for 28125