Hello, Serial Monitor
Part of the First Circuits section of Coddy's Arduino journey. Lesson 7 of 22.
The board can send text to your computer through its USB cable. The Serial monitor, under the board, shows what it sends.
Start the connection once, in setup():
Serial.begin(9600);9600 is the speed in bits a second, called the baud rate. On a real board, the Serial monitor must be set to the same speed, or the text comes out scrambled. 9600 is the usual choice.
Then send a line of text:
Serial.println("Hi there");Text goes between double quotes ". A piece of text in quotes is called a string. println means "print line": it sends the text, then moves to a new line.
Challenge
EasyGreet the Serial monitor once:
- in
setup(), start Serial at 9600 - then print
Hello, board! - leave
loop()empty
Press Run and watch the Serial monitor, then Check.
Try it yourself
void setup() {
// start Serial, then print the greeting
}
void loop() {
}
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in First Circuits
2Talking to Your Computer
Hello, Serial MonitorPrint Versus PrintlnPrinting NumbersYour First VariableCounting UpWhen an Int Runs OutPractice on your own: Arduino playground