Serial.availableForWrite versus Serial.flush Is there a difference between the following two line codes?


  
    while (Serial.availableForWrite &lt;= 0) {}
  


versus


  
    Serial.flush()
  


Thanks!
The line

while (Serial.availableForWrite() &lt;= 0) {}


waits until the serial output buffer is not full. Whereas

Serial.flush();


waits until the serial output buffer is empty.