Radio Shack Mobile Robot manual Speaker, LED indicators

Page 33

Whiskers

Whisker wires are used to detect objects while the robot is moving. There is a left and right whisker which can be read separately to determine the location of the object. The left whisker is connected to the P0 pin and the right whisker is connected to the P1 pin. When an object is detected, these pins return a logic zero (low). The pins must be in the input mode. The following PBasic code example shows how the whiskers can be read.

if

in0=0

then

wh1

'If

left whisker on then jump to wh1.

if

in1=0

then

wh2

'If

right whisker on then jump to wh2.

See the WANDER and TEST program for examples on how to use the whiskers for navigation.

It is possible to attach additional whiskers to the robot. Simply wire them to unused Basic Stamp pins available on the expansion connector and read them in your program. Mounting holes are provided for side and rear whiskers.

Speaker

A speaker is connected to P9 on the Basic Stamp II. It can be used to send various signals to the opera- tor. Simply toggle the pin at various frequencies to create different tones. Here’s a PBasic code exam- ple:

speaker

con

9

'Define

speaker

pin to 9.

freqout

speaker,200,1500

'200=frequency,

1500=duration.

low speaker

 

'Finish

with pin LOW.

It’s very important to leave the speaker output pin LOW when done or power will be drained from the battery. This pin should also be set LOW upon program startup. See WANDER and TEST programs for additional examples.

LED indicators

Green and red LED (Light Emitting Diodes) are mounted on the controller board and are connected to the Basic Stamp II pins P10 (red) and P11 (green). A low condition will turn an led on. Here’s a PBasic code example to control them:

redled

con 10

'Define red led pin.

grnled

con 11

'Define green led pin.

low grnled

'Green LED on.

high redled

'Red LED off.

To help conserve battery power, turn off the LEDs when not needed.

30

Image 33
Contents Assembly and User Guide ARobot Mobile Robot Connectors Introduction About ARobotBasic Stamp II Control Computer What You’ll Need Feature ListTechnical Specifications Precautions Controller Component LocatorGlossary of Terms Glossary of Terms Glossary of Terms Assembly Overview Parts Quantity Description Used ForAbout Screw, nut, and washer sizes Parts Motor Brackets Sanding PaintingPaint Primer Finish CoatWhiskers SummaryHow it Works Whisker Detail Full Scale Whisker Wire Pattern Drive Motor and Brackets Encoder Sensor Front Wheel Assembly Steering Motor and Rear Wheels Steering Motor Mounting Wheel and Axle Steering System Controller Board Battery Pack Don’t install batteries yetSummary Don’t install batteries yet Body Cable Finishing Up Basic Stamp II Installation About the Controller BoardProgramming PC Editor/Downloader Software Cable to your PCUSB Port Programming NotePrograms Steering Adjustment Program STRAIGHT.BS2Test Program TEST.BS2 Wander Program WANDER.BS2About the Controller Board Power On/Off Switch Reset ButtonBatteries Speaker LED indicatorsDrive Motor and Encoder Push Buttons and Jumpers switchesSteering Motor Example !1M11200E7 Coprocessor Command SummaryCoprocessor Communication Rules RC Servo Motor and Steering Motor ControlHexadecimal, Binary, Bytes, Words, etc Body Connector J8 Battery Connector J9Serial Port J12 PinoutDrive Motor Connector J10 RC Servo Motor Connectors J2-J5Powerful Connector J11 Voltage 12 volts Maximum Current 500ma PinoutExpansion Port RC Servo Motor Signals Expansion Connector J1Expansion Port Circuit Examples Digital/Power Output Switch Input ExampleDigital Inputs Sensor Input ExampleBasic Stamp II light sensor example code Analog InputsCommunications Coprocessor Network ExpansionUsing Other Controllers Using ARobot’s controller as a coprocessorCabling between ARobot’s controller and another controller Suggested Reading Component Suppliers Small Parts Sava IndustriesStock Drive Products SuperCircuitsWeb Sites Internet Robot ResourcesNewsgroup NameDescription Internet News GroupsTroubleshooting Arrick Robotics Warranty InformationRobotics.com