I got a Keyes bt_board v2.0 and connect it to arduino leonardo. I try to connect it to my notebook(with bluetooth). It can be find. I connect it with passcode 1234. It says connection is successful, but the bt board's LED still blinking in red. The device can be found in windows named HC-06 and the serial port is COM10. Then I open the Arduino IDE, I found there are COM11 only in the tool>serial port. So I select COM11 but see nothing receive in serial monitor. I also try to use coolterm. It can connect to COM11(red LED still blinking), but when I try to send command it doesn't have any respond but a loading icon appear in the bottom and TX is light green for a very long while.
please tell me what happen
here is the code I load to arduino
#define BUFFERSIZE 127
uint8_t inBuffer[BUFFERSIZE];
int inLength; // length of data in the buffer
int numLoop = 0; // number of times we looped
int ledPin = 13;
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}
void loop() {
// read string if available
if (Serial.available()) {
inLength = 0;
while (Serial.available()) {
inBuffer[ inLength] = Serial.read();
inLength++;
if (inLength >= BUFFERSIZE)
break;
}
Serial.print("Arduino received: ");
Serial.write(inBuffer ,inLength);
Serial.println();
}
// blink the led and send a number
digitalWrite(ledPin, HIGH); // set the LED on
delay(100); // wait a bit
Serial.println(numLoop);
digitalWrite(ledPin, LOW); // set the LED off
delay(1000);
numLoop++;
}
I use WIndows 7