60
User Manual
Copyright ©2003 A7 Engineering, Inc.
2.
Enter the following
program code
into the editor, replacing the device address with
the device address obtained from the iPAQ.
‘{$STAMP BS2}
nCount VAR BYTE
‘I/O Line 5 provides the connection status
INPUT 5
‘Wait for the eb500 radio to be ready
PAUSE 1000
‘Connect to the remote device
SEROUT 1,84,[“con 00:04:3E:62:FE:01”,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”,CR]
‘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 iPAQ, 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.
3.
On the
File
menu, click
Save As
.