Activity #3: Navigation With Whiskers - Parallax Boe-Bot Student Manual

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

Advertisement

Programming the LED Whisker Testing Circuits
Reconnect power to your board.
Save TestWhiskers.bs2 as TestWhiskersWithLeds.bs2.
Insert these two
commands.
IF (IN7 = 0) THEN
HIGH 1
ELSE
LOW 1
ENDIF
IF (IN5 = 0) THEN
HIGH 10
ELSE
LOW 10
ENDIF
These are called
IF...THEN
activity. These statements are used to make decisions in PBASIC. The first of the two
statements sets P1 high, which turns the LED on when the whisker connected to
IF...THEN
P7 is pressed (
IN7 = 0
turns the LED off when the whisker is not pressed. The second
the same thing for the whisker connected to P5 and the LED connected to P10.
RunTestWhiskersWithLeds.bs2.
Test the program by gently pressing the whiskers. The red LEDs should light up
when each whisker has made contact with its 3-pin header.

ACTIVITY #3: NAVIGATION WITH WHISKERS

In Activity #1, the BASIC Stamp was programmed to detect whether a given whisker
was pressed. In this activity, the BASIC Stamp will be programmed to take advantage of
this information to guide the Boe-Bot. When the Boe-Bot is rolling along and a whisker
is pressed, it means the Boe-Bot bumped into something. A navigation program needs to
take this input, decide what it means, and call a set of maneuvers that will make the Boe-
Bot back up from the obstacle, turn, and go in a different direction.
Chapter 5: Tactile Navigation with Whiskers · Page 177
...
statements between the
IF
THEN
statements, and they will be more fully introduced in the next
). The
portion of the statement makes P1 go low, which
ELSE
and
PAUSE 50
LOOP
statement does
IF...THEN

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Table of Contents

Save PDF