28125 Parallax Inc, 28125 Datasheet - Page 214

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
Figure 6-5: Modify RoamingWithWhiskers.bs2 for Use with Photoresistor Dividers
' From RoamingWithWhiskers.bs2
IF (IN5
ELSEIF (IN5
ELSEIF (IN7
ELSE
ENDIF
ACTIVITY #2: ROAM AND AVOID SHADOWS LIKE OBJECTS
Since the photoresistor dividers behave similarly to whiskers, it’s worth examining
what’s involved in adapting RoamingWithWhiskers.bs2 so that it functions with the
photoresistor dividers.
Adapting RoamingWithWhiskers.bs2 for the Photoresistor Dividers
All you really have to do is adjust the
IN3
Example Program – RoamingWithPhotoresistorDividers.bs2
GOSUB Back_Up
GOSUB Turn_Left
GOSUB Turn_Left
GOSUB Back_Up
GOSUB Turn_Right
GOSUB Back_Up
GOSUB Turn_Left
GOSUB Forward_Pulse
, instead of
Open the program RoamingWithWhiskers.bs2 from page 179, and save it as
RoamingWithPhotoresistorDividers.bs2.
Make the modifications shown in Figure 6-5.
Reconnect power to your board and servos.
Run and test the program.
= 0) AND (IN7 = 0) THEN
IN7
= 0) THEN
= 0) THEN
and
IN5
. Figure 6-5 demonstrates how to make these changes.
IF…THEN
' Modified for
' RoamingWithPhotoresistor
' Dividers.bs2
IF (IN6
ELSEIF (IN6
ELSEIF (IN3
ELSE
ENDIF
GOSUB Back_Up
GOSUB Turn_Left
GOSUB Turn_Left
GOSUB Back_Up
GOSUB Turn_Right
GOSUB Back_Up
GOSUB Turn_Left
GOSUB Forward_Pulse
statements so that they monitor
= 0) AND (IN3 = 0) THEN
= 0) THEN
= 0) THEN
IN6
and

Related parts for 28125