Hi
I have a Arduino Uno R3 and a Bluetooth Mate.
When linking the Mate to the Arduino Hardware Serial (pin 0,1) I can send multiple characters at once from my connected device but when I try to make the same thing with Software Serial (using pin 4,2 for example) I only get the first character and the rest of the chars are messed up.
My code:
#include <SoftwareSerial.h>
int bluetoothTx = 4;
int bluetoothRx = 2;
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
void setup()
{
Serial.begin(115200);
bluetooth.begin(115200);
}
void loop()
{
if(bluetooth.available())
{
Serial.print((char)bluetooth.read());
}
}
For example if I send this chars: abcd from my android device I get this in the serial monitor: a±,ö
This code that uses Hardware Serial (I link my bluetooth to pins 0 and 1) works just fine:
void setup()
{
Serial.begin(115200);
}
void loop()
{
if(Serial.available())
{
Serial.print((char)Serial.read());
}
}
I even tried changing the baud rate but it didn't helped