Hi all,
I’m rather new to Serial Programming. I was trying to get the Arduino Uno with a Bluesmirf Gold from Sparkfun to connect to my cell phone (1st Generation Moto Droid.) I wanted it to be in autoconnect mode so that was SM,3 and I tried to preset the address to my phone’s.
I tried reading the command list from the data sheet and I’ve attached my basic code.
After pairing with the Firefly (thats the device name?) from my phone, my code does not seem to make the Bluesmirf initialize a connection with my phone. Another interesting problem is that when i send “L” in a loop, the TX-light on the Arduino runs constantly as it should. However, thinking that the USB serial was confusing the Arduino, upon running off external power, the TX-light turns off - even upon reset. Then when I put back the USB, the TX-light stays off until another reupload.
Here’s my code:
void setup() {
Serial.begin(115600);
}
void loop() {
Serial.println(“$$$”); //I tried print() as well - not sure if I need the newline
Serial.println(“SR,0024BA921ACF”);
Serial.println(“SM,3”);
while(Serial.available() == 0)
{
Serial.print(“L”);
}
}
As an additional note, I connected RTS-0 with CTS-1 (though I’m unsure what that really does, I saw them on some other examples)
If you guys could help me set up this connection and let me know what I’m doing wrong - I would really appreciate it.
Thanks,
Wezzles