Hi am sending data from my android phone through bluetooth and receiving using a BT module wired up to arduino board. The message am sending is P2P
and this is that i get P?¨
.
In my other testes with sending different characters i always get the first character but the rest are always weird .
please hep this is the code am using
#include <NewSoftSerial.h>
NewSoftSerial mySerial(7, 6);
int ledPin = 13;
byte pinState = 1;
void setup()
{
pinMode(ledPin, OUTPUT);
Serial.begin(57600);
mySerial.begin(115200);
}
void loop()
{
if (mySerial.available())
{
Serial.print((char)mySerial.read());
toggle(13);
}
}
void toggle(int pinNum)
{
digitalWrite(pinNum, pinState);
pinState = !pinState;
}
this is how am sending the bytes from android
String message = "Hello World";
byte[] msgBuffer = message.getBytes();