Using the Serial Connection
Last updated
Last updated
The Serial connection provides a way for you to upload your code to your Arduino as well as see the data coming in from sensors and other input components.
In the Arduino program, set up your serial connection.
Go to Tools > Board > Arduino AVR Boards > Arduino Uno (or whatever you have)
Once you have the Arduino connected via USB, you can find and select the port that is needed under Tools > Port > COM(whatever number shows the connection)
In your code, in the setup()
function, use Serial.begin() to establish a connection. In the parentheses, put your baud rate (it has something to do with the connection speed). The most common is 9600.
As long as the Arduino is connected via USB to your computer, you can see this info two ways:
This is like a Console that you can print messages to using Serial.print()
and Serial.println()
.
This is a line graph that will interpret numbers in anything printed to the Serial monitor.