Hi there,
I am trying to send some strings to an Arduino UNO at 115.2kbps.
At times, it seems to miss out on certain letters/characters in the middle.
Trying at slower speeds seems to work better, though still had issues at 57.6kbps.
Is speed the problem here, or is there something else?
I have this running with another Software Serial Port which is talking to a display using 9600bps. Could they be clashing? If so I can easily move to an Arduino Mega.
Here is the code I am using:
// Input serial information:
while (Serial.available() > 0){
//Serial.println("Reading");
inByte = Serial.read();
// only input if a letter, number, are input
if ((inByte >= 65 && inByte <= 90) || (inByte >=97 && inByte <=122) || (inByte >= 48 && inByte <=57) ) {
command.concat(inByte);
}
}// end serial.available
//Serial.println(command);
if (inByte == 10 || inByte == 13){
//Serial.println("Pressed enter");
inByte = 0;
if (command.equalsIgnoreCase("string")){
genie.WriteStr(1, "Received string"); // sends message to screen.
}
}
Serial.print("Sent command: ");
Serial.println(command); // confirms the message sent
//Serial.println(command);
command = ""; //start over
}
I am hoping it is a simple error, and nothing fancy. I am of course initialising this with the write Serial.begin command and changing various speeds to try what it is doing.
I am using a 4D display (uLCD-43PT), and it has its own code but I have omitted that here for the sake of simplicity.