Hi,
I am working on a project for doing UART from my Android phone using the UNO as the Serial adapter.
The Android phone outputs UART on the USB d+/d- at baud 115200.
My code for this is basically:
#include <SoftwareSerial.h>
unsigned long BAUD=115200;
SoftwareSerial android(2,3);
void setup() {
Serial.begin(BAUD); //Initialize Computer baud
android.begin(BAUD); //Initialize android baud
Serial.println("Communications established");
}
void loop() {
if (Serial.available()) { //User has commanded input
android.write(Serial.read()); //Send to android
}
if (android.available()) { //Android wants to say something
Serial.write(android.read()); //Send to computer
}
}
My problem is that I get only garbage with this, it doesnt even resemble the output that the Android should output.
If I use an Mega with its Serial1 it works perfectly well (except some garbage when the device does a lot of output, probably some flow control missing).
I guess the UNOs software serial cant keep up with the Android at 115200?