EmbeddedBlue 500
55
Copyright ©2003 A7 Engineering, Inc.
‘Wait for the eb500 radio to be ready
PAUSE 1000
‘Connect to the remote device
SEROUT 1,84,[“con 00:80:C8:35:2C:B8”,CR]
SERIN 0,84,[WAIT(“ACK”,CR)]
WaitForConnection:
IF in5 = 0 THEN WaitForConnection
DEBUG “Connected”,CR
FOR nCount = 1 to 10
SEROUT 1,84,[“Hello World”,13]
‘sending data
PAUSE
1000
‘wait
for
1
second
NEXT
‘I/O Line 6 allows us to switch to command mode
OUTPUT 6
‘Switch to Command Mode
LOW 6
SERIN 0,84,[WAIT(CR,”>”)]
‘Disconnect from the remote device
SEROUT 1,84,[“dis”,CR]
SERIN 0,84,[WAIT(CR, “>”)]
DEBUG “Disconnected”,CR
The BASIC Stamp application establishes a connection with the remote eb500
device, waits for the connection to be established, then transmits “Hello World” ten
times, switches back to command mode, and then disconnects from the remote
device.
The first call to SEROUT is used when the eb500 is in command mode and instructs
the eb500 to establish a connection with the device specified. Once a connection is
established the eb500 is in data mode, which causes further calls to SEROUT to be
sent to the remote device.
33.
On the
File
menu, click
Save As
.
This will display the Save As dialog.
34.
In the
File name
box, enter a file name to which to save the program just created.
For example, HelloWorld.bs2.
35.
Click
Save
.