40
User Manual
Copyright ©2003 A7 Engineering, Inc.
Communications
This section contains a number of exercises that demonstrate methods of communicating
over a Bluetooth wireless connection with the eb500. The scenarios described are not
meant to form an exhaustive list, but rather illustrate a number of more common and useful
configurations. All source code shown in these exercises are available in electronic form on
the accompanying CD, in the Samples folder, using the filename used in this manual.
Communicating between Two eb500 Modules
In this exercise we will step through the process of communicating between two eb500
modules, one inserted into a Boe-Bot robot and the other inserted into a SumoBot robot. We
will program the SumoBot to use its infrared sensors to follow an object and then transmit its
movements to the Boe-Bot. The Boe-Bot will use the received information to mimic the
movements of the SumoBot.
To perform this exercise, as documented, you will need a Boe-Bot, a SumoBot, and two
eb500 modules. If you are using any of the other supported Parallax robots, you may need
to make adjustments to this exercise.
Step 1: Create a Monkey-See Application for the SumoBot
In this step we will create a BASIC Stamp application that will use the infrared
sensors of the SumoBot to follow an object and transmit its movements to a remote
eb500.
1.
Open the
BASIC Stamp Editor
.
2.
Enter the following
program code
into the editor, replacing the Bluetooth device
address with the device address of the eb500 inserted into the Boe-Bot robot.
'{$STAMP BS2}
‘I/O Line 5 provides the connection status
INPUT 5
'-----[I/O Definitions]---------------------------------------