Skip to content

Commit 1a84777

Browse files
authored
Merge pull request #951 from arduino/karlsoderby/serial-event
serialEvent() description update.
2 parents 83b71f7 + 1374589 commit 1a84777

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Language/Functions/Communication/Serial/serialEvent.adoc

+7-5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ title: serialEvent()
1515
[float]
1616
=== Description
1717
Called at the end of link:../../../../structure/sketch/loop[`loop()`] when data is available. Use `Serial.read()` to capture this data.
18+
19+
*Please note:* most modern boards do not support this method. See "Notes and Warnings" further below this article.
1820
[%hardbreaks]
1921

2022

@@ -27,7 +29,9 @@ void serialEvent() {
2729
//statements
2830
}
2931
----
30-
For boards with additional serial ports (see the list of available serial ports for each board on the link:../../serial[Serial main page]):
32+
33+
The Mega 2560 R3 has additional serial ports which can be accessed by adding the corresponding number at the end of the function.
34+
3135
[source,arduino]
3236
----
3337
void serialEvent1() {
@@ -63,11 +67,9 @@ Nothing
6367

6468
[float]
6569
=== Notes and Warnings
66-
`serialEvent()` doesn't work on the Leonardo, Micro, or Yún.
67-
68-
`serialEvent()` and `serialEvent1()` don't work on the Arduino SAMD Boards
70+
Please note that `serialEvent()` *does not work* on any modern Arduino boards. The only recognized boards to have support as of 2023/12/06 is the *UNO R3* and *Mega 2560 R3*, which are based on the ATmega328P and ATmega2560 chips.
6971

70-
`serialEvent()`, `serialEvent1()`, `serialEvent2()`, and `serialEvent3()` don't work on the Arduino Due.
72+
Instead, you can use the link:../available[`available()`] method. Examples in this page demonstrates how to read serial data only when it is available, which is exactly what `Serial.event()` does.
7173
[%hardbreaks]
7274

7375
--

0 commit comments

Comments
 (0)