Hi,
first of al, english is not my first nor my second language so I'll try to do my best.
In the past few months I worked with the arduino 0022 software. Yesterday I finaly downloaded the new Arduino 1.0 software, where I found some interesting new feature in the serial.print function:
arduino reference page: "As of version 1.0, serial transmission is asynchronous; Serial.print() will return before any characters are transmitted."
So I made a little sketch to test this.
void loop() //Main Loop
{
timebegin = millis(); //take the time before sending data
Serial.print("lkjljlkjlkjljlkjlkjlkjlkjlkjlkjlkj"); // some random text, not important
timeend = millis(); //take the time afte sending data
Serial.println();
Serial.print(timeend);
Serial.print(",");
Serial.println(timeend);
delay(100); //wait some time before doing this loop again.
}
If I do timeend - timebegin. I get a value of 5ms. So the serial.print function took 5ms before returning. I compiled this sketch with arduino 0022 and arduino 1.0. There is no difference in time so where is the asynchronous ???
So if in arduino 1.0 the Serial.print() really would return before any characters are transmitted, why does It take 5ms to return and why is there no difference in time with the arduino 0022 version?
Moderator edit:
[code] [/code] tags added.