Hi ,
please , i'm stack here for a week
So i want to save the informations executed by the ATND command.
I have a network of 8 nodes , i wrote an arduino code to read the result of ATND command executed by each node,
then i'll use a data logger to save it into a file.
So my proble , the code is good for 4 nodes, but any extensino of number of nodes , i can't get enough informations in the serial
Please Has anyone any idea how to resolve it.
I'm guessing maybe it's a problem of time, cause when i write the command manually in the terminal , there's no problem,
And cause when i change the delay time , i get always a different result
So i want to save the informations executed by the ATND command.
The information isn't executed. It's allowed to live. It is returned by the ATND command. How depends on how you execute the ATND command.
So my proble , the code is good for 4 nodes, but any extensino of number of nodes , i can't get enough informations in the serial
Why not? The amount of information you can read from the serial port has no relation to the size of the buffer, unless you are diddling around taking too long before reading it.
Writing to the array, when i exceeds the length of the array is really not a good idea.
Why is it necessary to copy the ith element to another variable? Why not just print the i-1 value?
Why are you delay()ing after printing one character? During that time, you could easily be overflowing the serial buffer.
while (Serial.available() > 0) {
Serial.write(Serial.read());
bOK = true;
}
What is this doing? What purpose is served by sending the same data back to the sender?
It looks to me like you are trying to use the hardware serial port to talk to the PC and to the XBee, hoping like hell that each ignores the data meant for the other. That is a quite unrealistic hope.
OK Thank you Sir for your help
And here is my new code, But I get a new problem : the arduino UNO board resets automatically in few seconds
Attached is a link for the picture i took as a result of the code.
There's a bunch of data to read. Read one character. Wait an eternity. Print it. Wait half an eternity. See if there is more data to read. Repeat as required. No!