Here is how I connect:
BT_device <-> arduino
VCC <-> 5V
GND <-> GND
TX <-> RX1(or 2 , 3)
RX <-> TX1
The BT device did successfully connected, but it only receive "224" when I send other numbers(recive"0"or"-1"when not sending)
I have checked with PC BT_device that the message I send is correct
Is my BT device broken(that is new :P),or I missed something?
=====Here is my code===== #include <SoftwareSerial.h>
int BTread;
Reading data that may not have arrived, and then printing it, is not a good idea. There IS an available() method in the HardwareSerial class.
If you use that method, the data that read() method returns will fit in a char, instead of an int. I suspect that you'll be a lot happier if you can use a char, instead.
Dear PaulS:
Thanks for you rapid reply
I am sorry that the problem still exist. The monitor keep showing blank(nothing) and à when I change int to char.
Is there hardware or software problem ?
Thanks again
Jay
Here is my modified code:
char BTread;
void setup()
{
 Serial.begin(57600);
 Serial1.begin(57600);
}
void loop()
{
if (Serial1.available() > 0)
{
BTread =Serial1.read();
Serial.println("");
Serial.println(BTread);
}
}