When I run the following code with a Bluetooth 2.0 Shield in place, nothing happens - the project itself has nothing to do with Bluetooth technology (I have setup the breadboard appropriately with an LED at pin 13 and to negative with protection resistor - checked multiple times without the shield):
#include <SoftwareSerial.h>
#define DEBUG_ENABLED 1
#define RxD 8
#define TxD 9
SoftwareSerial blueToothSerial(RxD,TxD);
void setup()
{
Serial.begin(9600);
pinMode(RxD, INPUT);
pinMode(TxD, OUTPUT);
pinMode(13, OUTPUT);
setupBlueToothConnection();
}
void loop()
{
delay(200);
digitalWrite(13, LOW);
delay(200);
digitalWrite(13, HIGH);
}
void setupBlueToothConnection()
{
blueToothSerial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
blueToothSerial.print("\r\n+STWMOD=0\r\n"); //set the bluetooth work in slave mode
blueToothSerial.print("\r\n+STNA=HyDrive\r\n"); //set the bluetooth name as "SeeedBTSlave"
blueToothSerial.print("\r\n+STOAUT=1\r\n"); // Permit Paired device to connect me
blueToothSerial.print("\r\n+STAUTO=0\r\n"); // Auto-connection should be forbidden here
delay(2000); // This delay is required.
blueToothSerial.print("\r\n+INQ=1\r\n"); //make the slave bluetooth inquirable
Serial.println("The slave bluetooth is inquirable!");
delay(2000); // This delay is required.
blueToothSerial.flush();
}
Any help? I don't think I may have configured the shield appropriately... Thanks in advance!