What is Serial.begin(9600)?

preview_player
Показать описание
🤩 FREE Arduino Crash Course 👇👇

Want to learn more? Check out our courses!

***Get the code, transcript, challenges, etc for this lesson on our website***

We designed this circuit board for beginners!

SHOP OUR FAVORITE STUFF! (affiliate links)
---------------------------------------------------

We use Rev Captions for our subtitles

Arduino UNO R3:

Budget Arduino Kits:

Multimeter Options:

Helping Hands:

Soldering Stations:

AFFILIATES & REFERRALS
---------------------------------------------------

FOLLOW US ELSEWHERE
---------------------------------------------------

WHAT IS SERIAL.BEGIN(9600)?

What if you change the number 9600? I mean, what’s 9600 even mean?!

WHAT DOES SERIAL.BEGIN(9600) DO?
Let’s get straight to this…

When you have established serial communication between two devices, it allows the two devices to communicate using a serial protocol.

So let’s answer a couple practical questions…

WHEN DO I NEED TO USE SERIAL.BEGIN()?

That is, you want to print some text out.

void setup() {
}

void loop() {
}
The text that gets printed out shows up on the Serial Monitor window – which can be opened from the menu bar under Tools / Serial Monitor. Or with the shortcut key CTRL + SHIFT + M (on PC) or Command + Shift + M (MacOs).

WHERE DOES SERIAL.BEGIN() GO IN THE ARDUINO SKETCH?

WHAT’S WITH THE NUMBER 9600?

If you are using the Arduino IDE Serial Monitor window to read the information from your Arduino, then you can use the baud rate drop down to set the baud rate.

Remember! If these two values don’t match – then anything you try to send over serial will not work right.

It’s like, as a kid, did you and a friend ever come up with a long distance communication protocol?

Like, 2 hoots meant, “Is anyone at the fort?”, and the appropriate response was two hoots back?

But if you both didn’t agree on that protocol beforehand, and your friend was cawing, instead of hooting, then you were like, what is he trying to say? Same thing with the baud rate – remember these have to match!
Рекомендации по теме
Комментарии
Автор

We need more and more tutorials like this in future. Ur content are so clear and to the point.

Sekhar_Home
Автор

This is one of the reason I signed up, best learning program techniques I ever had. 😊

Anthonylopez-rdnr
Автор

I'm just starting out; this was helpful. Thanks.

DaisyHollowBooks
Автор

So apart from making sure that they match, are there any advantages to a faster or slower baud rate?

JustJimWillDo
Автор

Can you have 2 baud rates for different pieces of equipment on different serial busses in the same program. For example a thermocouple device on one spi bus and an spi tft screen that runs at a different speed.

ClipheApex
Автор

Your voice sounds more natural with 2.5x playback speed 😂

ptptp
Автор

This recommendation can't be a coincidence..

tarunkr