SerialEvent
Demonstrates the use of serialEvent() function.
This example demonstrates use of the serialEvent() function. This function is automatically called at the end of
loop()
when there is serial data available in the buffer. In this case, each character found is added to a string until a newline is found. Then the string is printed and set back to null.Hardware Required
- Arduino Board
Circuit
None, but the board has to be connected to the computer; the Arduino Software (IDE) serial monitor may be used to communicate the single or multiple characters and receive the string back.
Code
Learn more
You can find more basic tutorials in the built-in examples section.
You can also explore the language reference, a detailed collection of the Arduino programming language.
Last revision 2015/07/29 by SM
Suggested changes
The content on docs.arduino.cc is facilitated through a public GitHub repository. You can read more on how to contribute in the contribution policy.
License
The Arduino documentation is licensed under the Creative Commons Attribution-Share Alike 4.0 license.