Hi,
Your connect is fine.
BTW: which mode you use the bluetooth module as? If you want to use the PC to send the data to it, you should set the bluetooth module as a slave. And you can find the equipment on the PC. Here is the demo code of the Arduino which set the the bluetooth module as slave, you can refer to it.
[code]
#include <LiquidCrystal.h>
#include <NewSoftSerial.h>
#include <string.h>
NewSoftSerial mySerial(11, 12);//pin2-Rx,pin3-Tx
//LiquidCrystal lcd(10, 11, 12, 13, 14, 15, 16);
char addrBuffer[64];
int addrLen = 0;
char specName[]=“seeedstudio”;
void setup()
{
Serial.begin(9600);
Serial.println(“Goodnight moon!”);
// set the data rate for the NewSoftSerial port
mySerial.begin(38400);
//mySerial.println(“Hello, world?”);
//lcd.print(“hello world”);//display “hello world” on lcd module
//lcd.setCursor(0, 1);//display received info on the next row of LCD
}
void FlashLed(unsigned char ledPin,int times, int interval)
{
pinMode(ledPin,OUTPUT);
for(int i = 0; i < times; i++)
{
digitalWrite(ledPin,HIGH);
delay(interval);
digitalWrite(ledPin,LOW);
delay(interval);
}
}
void CheckOK()
{
//Serial.print("\r\n\r\n**********start**************");
char a,b;
while(1)
{
if(int len = mySerial.available())
{
a = mySerial.read();
//Serial.print(a);
if(‘O’ == a)
{
b = mySerial.read();
//Serial.print(b);
if(‘K’ == b)
{
Serial.print(“OK”);
break;
}
}
}
}
while( (a = mySerial.read()) != -1)
{
//Serial.print(a);
}
//Serial.println("\r\n**over");
}
void GetSlaveAddr(char *addr,int *addrLen,char *specName, int nameLen)
{
char a,b;
while(1)
{
if(int len = mySerial.available())
{
a = mySerial.read();
Serial.print(a);
if(’=’ == a)
{
while(1)
{
int i = 0;
a = mySerial.read();
Serial.print(a);
if( a != -1)
{
//Serial.print(“break1”);
if( ‘;’== a)
{
delay(500);
*addrLen = i;
char tempName[20];
for(int j = 0;j < nameLen; j++)
{
a = mySerial.read();
Serial.print(a);
if('+' == a)
{
//Serial.println("break1");
break;
}
else
{
tempName[j] = a;
}
}
int flag = 0;
for(int k = 0; k < nameLen; k++)
{
if(tempName[i] != specName[i])
{
flag = 1;
}
}
if(0 == flag)
{
//Serial.print("break2");
return;
}
else
{
//Serial.print("continue");
break;
}
}
else
{
addr[i++] = a;
}
}
}
}
}
}
}
void loop()
{
// mySerial.print("\r\n+STWMOD=0\r\n");
//delay(1000);
//enable been inquired
mySerial.print("\r\n+INQ=1\r\n");
while(1)
{
if(mySerial.available())
{
if(mySerial.read() == ‘4’)
{
Serial.println(“OK OK!”);
}
if(mySerial.read() == ‘3’)
{
mySerial.print("\r\n+INQ=1\r\n");
}
}
}
}[/code]
BluetoothBeeSlaveTest.zip (1.37 KB)
LiquidCrystal.zip (14.7 KB)
NewSoftSerial.zip (7.43 KB)