🤩 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!
Kit-On-A-Shield: [ Ссылка ]
SHOP OUR FAVORITE STUFF! (affiliate links)
---------------------------------------------------
We use Rev Captions for our subtitles
[ Ссылка ]
Arduino UNO R3:
Amazon: [ Ссылка ]
Newegg: [ Ссылка ]
Budget Arduino Kits:
Amazon:[ Ссылка ]
Newegg:[ Ссылка ]
Multimeter Options:
Amazon: [ Ссылка ]
Newegg: [ Ссылка ]
Helping Hands:
Amazon: [ Ссылка ]
Newegg: [ Ссылка ]
Soldering Stations:
Amazon: [ Ссылка ]
Newegg: [ Ссылка ]
AFFILIATES & REFERRALS
---------------------------------------------------
►Audible Plus Free trial: [ Ссылка ]
►Join Honey- Save Money [ Ссылка ]
►Download Glasswire for Free:[ Ссылка ]
FOLLOW US ELSEWHERE
---------------------------------------------------
Facebook: [ Ссылка ]
Twitter: [ Ссылка ]
Website: [ Ссылка ]
WHAT IS SERIAL.BEGIN(9600)?
Are you wondering what Serial.begin(9600) does?
You’ve probably seen it in most of the Arduino programs you’ve looked at – but what’s it there for?! Do you even need to use Serial.begin()?
What if you change the number 9600? I mean, what’s 9600 even mean?!
In this lesson you will learn exactly what Serial.begin does, when you NEED to use it, and what the heck the 9600 means.
WHAT DOES SERIAL.BEGIN(9600) DO?
Let’s get straight to this…
Serial.begin() establishes serial communication between your Arduino board and another device. The most common use of serial communication you will establish is between your Arduino and your computer via a USB cable – or should I say a Universal Serial Bus cable.
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()?
The most common reason to use serial.begin() is when you want to output some information from your Arduino to your computer screen.
That is, you want to print some text out.
The function used to display text on your computer screen from your Arduino board is the serial.print() function.
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.print("Look Ma, I’m in the phone book!");
}
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).
There are other times you’ll use serial.begin(), for example, maybe you have an application running on your computer that will be expecting data from your Arduino over a serial port. In these cases, you’ll also need Serial.begin().
WHERE DOES SERIAL.BEGIN() GO IN THE ARDUINO SKETCH?
99% of the time, you’ll be putting the Serial.begin() function inside of the setup() function. As you may know, setup() only runs once, and since you’ll only need to establish the Serial Communication one time – it makes sense to have it there.
WHAT’S WITH THE NUMBER 9600?
That number is called the baud rate. Probably the most important practical thing you need to know, is that for serial communication to work the baud rate in Serial.begin() and the baud rate set on the receiving device need to match.
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!
Ещё видео!