Skip to Main Content
Arduino Cookbook, 2nd Edition
book

Arduino Cookbook, 2nd Edition

by Michael Margolis
December 2011
Intermediate to advanced content levelIntermediate to advanced
724 pages
16h 19m
English
O'Reilly Media, Inc.
Content preview from Arduino Cookbook, 2nd Edition

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.

Arduino Serial Monitor screen
Figure 4-1. Arduino Serial Monitor screen

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Arduino Cookbook, 3rd Edition

Arduino Cookbook, 3rd Edition

Michael Margolis, Brian Jepson, Nicholas Robert Weldin
Arduino Cookbook

Arduino Cookbook

Michael Margolis

Publisher Resources

ISBN: 9781449321185Errata PageSupplemental Content