Problem Programming RN-41 Bluetooth using Arduino

Hi, I am using my Arduino Mega 2560, and trying to program my RN-41 Bluetooth device, using the sample code provided on the bluetooth’s homepage. The code seems fairly straightforward, and is as follows:

#include <SoftwareSerial.h>  

int bluetoothTx = 46;  // TX-O pin of bluetooth mate, Arduino D2
int bluetoothRx = 45;  // RX-I pin of bluetooth mate, Arduino D3
char data;
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);

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("$");  // 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
  Serial.print("<Arduino is ready>");

void loop()
  if(bluetooth.available())  // If the bluetooth sent any characters
    data =;
    // Send any characters the bluetooth prints to the serial monitor
  if(Serial.available())  // If stuff was typed in the serial monitor
    data =;
    // Send any characters the Serial monitor prints to the bluetooth
  // and loop forever and ever!

My problem is, after opening up the Serial Monitor, and entering the $$$ command to enter into command mode, the tutorial mentions that the bluetooth should respond with CMD to confirm that I am in command mode. However, it does not respond, in fact, there is nothing printed in return from the bluetooth. If I am missing some simple step, please help. I’m going crazy!!!

Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69).

Pays to RTFM.

On the other hand, using SoftwareSerial while three hardware serial ports are not used does not make sense.