Bluetooth Mate Silver - Cannot exchange data in data mode

Hello,

I was able to set up a connection with my Mate Silver and was able to enter into command mode after entering ‘$$$’. However, I am having trouble actually exhanging data in the data mode. The following is my code:

void setup()
{
  Serial.begin(9600);  // Begin the serial monitor at 9600bps

  bluetooth.begin(115200);  // The Bluetooth Mate defaults to 115200bps
  bluetooth.print("$");  // Print three times individually
  bluetooth.print("$");
  bluetooth.print("$");  // Enter command mode
  delay(100);  // Short delay, wait for the Mate to send back CMD
  bluetooth.println("U,9600,N");  // Temporarily Change the baudrate to 9600, no parity
  // 115200 can be too fast at times for NewSoftSerial to relay the data reliably
  bluetooth.begin(9600);  // Start bluetooth serial at 9600
}

void loop()
{
  if(bluetooth.available())  // If the bluetooth sent any characters
  {
    // Send any characters the bluetooth prints to the serial monitor
    char btReceived;
    btReceived = (char)bluetooth.read();

    Serial.print("Received from BT module :");
    Serial.println(btReceived); 

    if (btReceived=='y')
    {
      Serial.println("Agreed to received from BT");
    }
  }
  if(Serial.available())  // If stuff was typed in the serial monitor
  {
    // Send any characters the Serial monitor prints to the bluetooth
    bluetooth.print((char)Serial.read());

 
  // and loop forever and ever!
  }
}

After exiting from the command mode, I am not getting any response after entering ‘y’? I’m not getting ‘Received from BT module :’ from my serial monitor either…

Any help will be much appreciated.

You might try the un-modified example code in the [hookup guide first.

When you pair the module to your computer do you see a new serial port? Are you connecting to that port from a second serial terminal or the serial monitor? You really need a second serial terminal program so that you can see data passing from one terminal window to the other.](Using the BlueSMiRF - SparkFun Learn)

Hello Chris,

Thank you for your reply. I managed to get the passing of data to work through following the hookup guide closely.

However, would you be able to advise on how I could pair the RN-42 with an Arduino Lilypad when I use an Arduino Uno to upload codes to the Lilypad?

I’m not quite sure what you’re asking.

Are you wanting to physically connect the RN42 to an Arduino Lilypad? That would work just the same as connecting it to an Uno. Any code you write for the Uno will also work in the Lilypad.