28125 Parallax Inc, 28125 Datasheet - Page 191

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
Programming the LED Whisker Testing Circuits
These are called
activity. These statements are used to make decisions in PBASIC. The first of the two
IF…THEN
P7 is pressed (
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.
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.
Reconnect power to your board.
Save TestWhiskers.bs2 as TestWhiskersWithLeds.bs2.
Insert these two
commands.
IF (IN7 = 0) THEN
ELSE
ENDIF
IF (IN5 = 0) THEN
ELSE
ENDIF
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.
statements sets P1 high, which turns the LED on when the whisker connected to
HIGH 1
LOW 1
HIGH 10
LOW 10
IN7 = 0
IF…THEN
). The
statements, and they will be more fully introduced in the next
IF
...
THEN
ELSE
portion of the statement makes P1 go low, which
statements between the
IF…THEN
PAUSE 50
statement does
and
LOOP

Related parts for 28125