Skip to content

Commit ae039c9

Browse files
authored
Merge PR #520 "Document the limits of serial transmission asyncronicity " from per1234
Document the limits of serial transmission asyncronicity
2 parents df0fa46 + fc1a606 commit ae039c9

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

Language/Functions/Communication/Serial/print.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void loop() {
121121

122122
[float]
123123
=== Notes and Warnings
124-
As of version 1.0, serial transmission is asynchronous; `Serial.print()` will return before any characters are transmitted.
124+
For information on the asyncronicity of `Serial.print()`, see the Notes and Warnings section of the link:../write#howtouse[Serial.write() reference page].
125125

126126
--
127127
// HOW TO USE SECTION ENDS

Language/Functions/Communication/Serial/println.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ void loop() {
8080
delay(10);
8181
}
8282
----
83+
[%hardbreaks]
84+
85+
[float]
86+
=== Notes and Warnings
87+
For information on the asyncronicity of `Serial.println()`, see the Notes and Warnings section of the link:../write#howtouse[Serial.write() reference page].
8388

8489
--
8590
// HOW TO USE SECTION ENDS

Language/Functions/Communication/Serial/write.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ void loop(){
6666
int bytesSent = Serial.write(“hello”); //send the string “hello” and return the length of the string.
6767
}
6868
----
69+
[%hardbreaks]
70+
71+
[float]
72+
=== Notes and Warnings
73+
As of Arduino IDE 1.0, serial transmission is asynchronous. If there is enough empty space in the transmit buffer, `Serial.write()` will return before any characters are transmitted over serial. If the transmit buffer is full then `Serial.write()` will block until there is enough space in the buffer. To avoid blocking calls to `Serial.write()`, you can first check the amount of free space in the transmit buffer using link:../availableforwrite[availableForWrite()].
6974

7075
--
7176
// HOW TO USE SECTION ENDS

0 commit comments

Comments
 (0)