Hi everyone. I have conected a microcontroller that sends by serial port a data. The Arduino Due sends a request data and later receives this datas and print it by serial port monitor.
The problem is that I get to receive ONLY four times this data. Later, the Arduino don't print this data by serial port monitor. The problem seems that Arduino doesn't take more datas.
I am using the code example for receive the datas. What is the problem?
thanks!!
String inputString = ""; // a string to hold incoming data
boolean stringComplete = false; // whether the string is complete
void setup() {
// initialize serial:
Serial.begin(9600);
Serial1.begin(9600);
// reserve 200 bytes for the inputString:
inputString.reserve(200);
}
void loop() {
// print the string when a newline arrives:
Serial1.print("REQUESTDATA\r");
delay(1000);
if (stringComplete) {
Serial.print(inputString);
// clear the string:
inputString = "";
stringComplete = false;
}
}