EasyManuals Logo

Parallax Boe-Bot User Manual

Parallax Boe-Bot
360 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #214 background imageLoading...
Page #214 background image
Page 200 · Robotics with the Boe-Bot
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 IF…THEN statements so that they monitor IN6 and
IN3, instead of IN7 and IN5. Figure 6-5 demonstrates how to make these changes.
Figure 6-5: Modify RoamingWithWhiskers.bs2 for Use with Photoresistor Dividers
' From RoamingWithWhiskers.bs2
IF (IN5 = 0) AND (IN7 = 0) THEN
GOSUB Back_Up
GOSUB Turn_Left
GOSUB Turn_Left
ELSEIF (IN5 = 0) THEN
GOSUB Back_Up
GOSUB Turn_Right
ELSEIF (IN7 = 0) THEN
GOSUB Back_Up
GOSUB Turn_Left
ELSE
GOSUB Forward_Pulse
ENDIF
' Modified for
' RoamingWithPhotoresistor
' Dividers.bs2
IF (IN6 = 0) AND (IN3 = 0) THEN
GOSUB Back_Up
GOSUB Turn_Left
GOSUB Turn_Left
ELSEIF (IN6 = 0) THEN
GOSUB Back_Up
GOSUB Turn_Right
ELSEIF (IN3 = 0) THEN
GOSUB Back_Up
GOSUB Turn_Left
ELSE
GOSUB Forward_Pulse
ENDIF
Example Program – RoamingWithPhotoresistorDividers.bs2
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.

Table of Contents

Other manuals for Parallax Boe-Bot

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Parallax Boe-Bot and is the answer not in the manual?

Parallax Boe-Bot Specifications

General IconGeneral
BrandParallax
ModelBoe-Bot
CategoryRobotics
LanguageEnglish