Interacting with the Arduino
Frequently, you’ll want to see what’s going on inside your arduino in order to
understand how your circuit and code are working: either you’ll
want to see values being generated by your sketch, or you’ll want to read from a
sensor attached to the arduino.
Other times, you’ll need to be able to interact with your Arduino, using
values from your keyboard to affect how the program works.
For these purposes, Arduino comes with support for two interactive devices:
The Serial Console:
| allows you to view printed output from a sketch and to provide keyboard input from your sketch
The Serial Plotter:
| allows you to view changing input data from any pin on your Arduino
The Serial Console and the Serial Plotter are just other windows on your desktop;
Arduino supports opening one, but not both, at the same time.
To open the Serial Console, click
Tools -> Serial Console, or just
click the icon of a magnifying glass, located in the right side of the Arduino toolbar.
|Opening the Serial Console|
⚠ Alert! Whenever you open the Serial Console, you will restart your sketch.
When you open the console, you should see a new window like the one below.
|The Serial Console|
To open the Serial Plotter, click
Tools -> Serial Plotter.
|Opening the Serial Plotter|
The packets in this group show you:
How to print output to the Serial Console.
How to print nicely formatted output to the Serial Console.
How to provide input to your program and see output on the Serial Console.
How to view graphical output on the Serial Plotter.
⚠ Alert! Not all Arduino boards support the Serial Console or the Serial Plotter.
For example, Arduino boards with the Atmel ATTiny85 controller (like Adafruit’s
Trinket do not support the Serial Console.