jaydee532
11-30-2006, 02:14 PM
hey everyone,
for my senior project I want to get the embedded bluetooth transceiver eb500 to send a text message to my bluetooth capable cellphone. By running the following code, I am able to establish a connection with my phone, but once I accept the connection, my cellphone asks me to type in the pin number. I keep getting an invalid pin, so my question is, where do i find this pin number? Or am I suppose to write it in the code? Here is the code I have so far, any help is greatly appreciated.
' {$STAMP BS2}
' {$PBASIC 2.5}
'Wait for the eb500 radio to be ready
PAUSE 1000
'Connect to the remote device
SEROUT 1,84,["con XX:XX:XX:XX:XX:XX",CR]
SERIN 0,84,[WAIT( "ACK",CR)]
'Wait for the connection to be established and switch to data mode
WaitForConnection:
IF IN5 = 0 THEN WaitForConnection
HIGH 6
PAUSE 300
DEBUG "Connection established",CR
'Send "Hello World"
SEROUT 1,84,["Hello World",CR]
PAUSE 1000
'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, ">")]
for my senior project I want to get the embedded bluetooth transceiver eb500 to send a text message to my bluetooth capable cellphone. By running the following code, I am able to establish a connection with my phone, but once I accept the connection, my cellphone asks me to type in the pin number. I keep getting an invalid pin, so my question is, where do i find this pin number? Or am I suppose to write it in the code? Here is the code I have so far, any help is greatly appreciated.
' {$STAMP BS2}
' {$PBASIC 2.5}
'Wait for the eb500 radio to be ready
PAUSE 1000
'Connect to the remote device
SEROUT 1,84,["con XX:XX:XX:XX:XX:XX",CR]
SERIN 0,84,[WAIT( "ACK",CR)]
'Wait for the connection to be established and switch to data mode
WaitForConnection:
IF IN5 = 0 THEN WaitForConnection
HIGH 6
PAUSE 300
DEBUG "Connection established",CR
'Send "Hello World"
SEROUT 1,84,["Hello World",CR]
PAUSE 1000
'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, ">")]