Chapter 4. Serial Communications
4.0. Introduction
Serial communications provide an easy and flexible way for your Arduino board to interact with your computer and other devices. This chapter explains how to send and receive information using this capability.
Chapter 1 described how to connect the Arduino serial port to your computer to upload sketches. The upload process sends data from your computer to Arduino and Arduino sends status messages back to the computer to confirm the transfer is working. The recipes here show how you can use this communication link to send and receive any information between Arduino and your computer or another serial device.
Note
Serial communications are also a handy tool for debugging. You can send debug messages from Arduino to the computer and display them on your computer screen or an external LCD display.
The Arduino IDE (described in Recipe 1.3) provides a Serial Monitor (shown in Figure 4-1) to display serial data sent from Arduino.

You can also send data from the Serial Monitor to Arduino by entering text in the text box to the left of the Send button. Baud rate (the speed at which data is transmitted, measured in bits per second) is selected using the drop-down box on the bottom right. You can use the drop down labeled “No line ending” to automatically send a carriage return or a combination of a carriage ...