Using Serial.read() with Arduino | Part 1
🤩 FREE Arduino Crash Course 👇👇
https://bit.ly/get_Arduino_skills
Want to learn more? Check out our courses!
https://bit.ly/3u7DRmd
***Get the code, transcript, challenges, etc for this lesson on our website***
https://bit.ly/331I3Is
We designed this circuit board for beginners!
Kit-On-A-Shield: https://amzn.to/3lfWClU
SHOP OUR FAVORITE STUFF! (affiliate links)
---------------------------------------------------
Get your Free Trial of Altium PCB design Software
https://www.altium.com/yt/programmingelectronicsacademy
We use Rev Captions for our subtitles
https://bit.ly/39trLeB
Arduino UNO R3:
Amazon: https://amzn.to/37eP4ra
Newegg: https://bit.ly/3fahas8
Budget Arduino Kits:
Amazon:https://amzn.to/3C0VqsH
Newegg:https://bit.ly/3j4tISX
Multimeter Options:
Amazon: https://amzn.to/3rRo3E0
Newegg: https://bit.ly/3rJoekA
Helping Hands:
Amazon: https://amzn.to/3C8IYXZ
Newegg: https://bit.ly/3fb03X1
Soldering Stations:
Amazon: https://amzn.to/2VawmP4
Newegg: https://bit.ly/3BZ6oio
AFFILIATES & REFERRALS
---------------------------------------------------
►Audible Plus Free trial: https://amzn.to/3j5IGrV
►Join Honey- Save Money https://bit.ly/3xmj7rH
►Join Honey- Save Money https://bit.ly/3xmj7rH
►Download Glasswire for Free:https://bit.ly/3iv1fql
FOLLOW US ELSEWHERE
---------------------------------------------------
Facebook: https://www.facebook.com/ProgrammingElectronicsAcademy/
Twitter: https://twitter.com/ProgElecAcademy
Website: https://www.programmingelectronics.com/
Are you trying to use Serial.read() to get data from a serial port to your Arduino? Maybe you’re using the Arduino Serial Monitor window and sending in data, or maybe you’ve got a program running on your raspberryPi sending data via serial to your Arduino board.
How do you use serial.read() to receive the data, and piece it together correctly? In this lesson you will learn exactly how to use Serial.read() to receive data from the serial port and stitch it together as one value.
AN OVERVIEW WHAT WE’LL COVER:
The big picture of serial communication
The serial buffer
Serial.read and Serial.available
Developing a protocol and strategy for reading in data from the serial port
Implement the strategy in Arduino code
BONUS: How to convert the serial data from a string to an integer
THE BIG PICTURE OF SERIAL COMMUNICATION
Let’s take a step back from Serial.read(), and talk about Serial Communication.
Serial communication is the process of sending one bit of data at a time, sequentially, from one place to another. Like say, sending data from your raspberryPi to a connected Arduino, or vice versa.
USB is one of the most common methods used for serial communication, hence the name Universal Serial Bus. Using Arduino we can easily send and receive data over a USB cable with the built-in Arduino Serial Library.
Now if you don’t know what an Arduino library is, it’s basically a bunch of code that has been bundled together, because it is often used together.
Imagine you were a barber, maybe you have a specific drawer in your barber shop for all your hair cutting tools. Every time somebody walks in for a haircut, you know exactly where to look, in that hair cutting drawer, and all your tools are right there.
Maybe you have another drawer with all the stuff you need for dying peoples hair, when someone walks in and asks to get their hair dyed red, you know exactly which drawer to open. Same thing with Arduino libraries. Arduino libraries put together a bunch of software functions that help you with specific tasks.
SERIAL LIBRARY FUNCTIONS
For serial communication, we can use the built-in Arduino Serial library.
The Serial library has functions like:
Serial.begin()
Serial.read()
Serial.available()
Serial.parseInt()
Serial.parseString()
Serial.parseFloat()
Serial.print()
Serial.captCrunch()
OK, we know that Serial Communication over USB is how we can talk between one device and another, and we know that the Arduino Serial library is the set of tools we’ll use for serial communication. But where does the data that comes from another device actually go on the Arduino?
THE SERIAL BUFFER
The answer is the serial buffer, or perhaps more precisely, the serial receive buffer. When bits of data start streaming in from your computer, a piece of hardware on your Arduino called a UART will assemble each of the 8 bits into a byte, and store those bytes for you in the Serial Receive Buffer.
The serial receive buffer can hold 64 bytes.
The data you send from your computer, to your Arduino, will end up in the serial receive buffer.
How do you get this data? That is where Serial.read() comes in.
CONTINUED…
https://bit.ly/331I3Is
Видео Using Serial.read() with Arduino | Part 1 канала Programming Electronics Academy
https://bit.ly/get_Arduino_skills
Want to learn more? Check out our courses!
https://bit.ly/3u7DRmd
***Get the code, transcript, challenges, etc for this lesson on our website***
https://bit.ly/331I3Is
We designed this circuit board for beginners!
Kit-On-A-Shield: https://amzn.to/3lfWClU
SHOP OUR FAVORITE STUFF! (affiliate links)
---------------------------------------------------
Get your Free Trial of Altium PCB design Software
https://www.altium.com/yt/programmingelectronicsacademy
We use Rev Captions for our subtitles
https://bit.ly/39trLeB
Arduino UNO R3:
Amazon: https://amzn.to/37eP4ra
Newegg: https://bit.ly/3fahas8
Budget Arduino Kits:
Amazon:https://amzn.to/3C0VqsH
Newegg:https://bit.ly/3j4tISX
Multimeter Options:
Amazon: https://amzn.to/3rRo3E0
Newegg: https://bit.ly/3rJoekA
Helping Hands:
Amazon: https://amzn.to/3C8IYXZ
Newegg: https://bit.ly/3fb03X1
Soldering Stations:
Amazon: https://amzn.to/2VawmP4
Newegg: https://bit.ly/3BZ6oio
AFFILIATES & REFERRALS
---------------------------------------------------
►Audible Plus Free trial: https://amzn.to/3j5IGrV
►Join Honey- Save Money https://bit.ly/3xmj7rH
►Join Honey- Save Money https://bit.ly/3xmj7rH
►Download Glasswire for Free:https://bit.ly/3iv1fql
FOLLOW US ELSEWHERE
---------------------------------------------------
Facebook: https://www.facebook.com/ProgrammingElectronicsAcademy/
Twitter: https://twitter.com/ProgElecAcademy
Website: https://www.programmingelectronics.com/
Are you trying to use Serial.read() to get data from a serial port to your Arduino? Maybe you’re using the Arduino Serial Monitor window and sending in data, or maybe you’ve got a program running on your raspberryPi sending data via serial to your Arduino board.
How do you use serial.read() to receive the data, and piece it together correctly? In this lesson you will learn exactly how to use Serial.read() to receive data from the serial port and stitch it together as one value.
AN OVERVIEW WHAT WE’LL COVER:
The big picture of serial communication
The serial buffer
Serial.read and Serial.available
Developing a protocol and strategy for reading in data from the serial port
Implement the strategy in Arduino code
BONUS: How to convert the serial data from a string to an integer
THE BIG PICTURE OF SERIAL COMMUNICATION
Let’s take a step back from Serial.read(), and talk about Serial Communication.
Serial communication is the process of sending one bit of data at a time, sequentially, from one place to another. Like say, sending data from your raspberryPi to a connected Arduino, or vice versa.
USB is one of the most common methods used for serial communication, hence the name Universal Serial Bus. Using Arduino we can easily send and receive data over a USB cable with the built-in Arduino Serial Library.
Now if you don’t know what an Arduino library is, it’s basically a bunch of code that has been bundled together, because it is often used together.
Imagine you were a barber, maybe you have a specific drawer in your barber shop for all your hair cutting tools. Every time somebody walks in for a haircut, you know exactly where to look, in that hair cutting drawer, and all your tools are right there.
Maybe you have another drawer with all the stuff you need for dying peoples hair, when someone walks in and asks to get their hair dyed red, you know exactly which drawer to open. Same thing with Arduino libraries. Arduino libraries put together a bunch of software functions that help you with specific tasks.
SERIAL LIBRARY FUNCTIONS
For serial communication, we can use the built-in Arduino Serial library.
The Serial library has functions like:
Serial.begin()
Serial.read()
Serial.available()
Serial.parseInt()
Serial.parseString()
Serial.parseFloat()
Serial.print()
Serial.captCrunch()
OK, we know that Serial Communication over USB is how we can talk between one device and another, and we know that the Arduino Serial library is the set of tools we’ll use for serial communication. But where does the data that comes from another device actually go on the Arduino?
THE SERIAL BUFFER
The answer is the serial buffer, or perhaps more precisely, the serial receive buffer. When bits of data start streaming in from your computer, a piece of hardware on your Arduino called a UART will assemble each of the 8 bits into a byte, and store those bytes for you in the Serial Receive Buffer.
The serial receive buffer can hold 64 bytes.
The data you send from your computer, to your Arduino, will end up in the serial receive buffer.
How do you get this data? That is where Serial.read() comes in.
CONTINUED…
https://bit.ly/331I3Is
Видео Using Serial.read() with Arduino | Part 1 канала Programming Electronics Academy
Показать
Комментарии отсутствуют
Информация о видео
1 мая 2021 г. 18:26:29
00:10:30
Другие видео канала
Amazing Garden Experiment: Testing 20 Pounds Weight & Water Level SensorExtremely Tiny Arduino LilyPad - Washing Machine Safe - The E-textile TinyLilySerial.begin: How to Use Arduino's Serial Library for CommunicationLED Knuckle Glove using miniaturized Arduino LilyPad [Ozzy Osbourne Knuckle Tattoo Wanna Be]Discover the Fastest Arduino Uno Board: Arduino Uno R-IV Wi-Fi with ESP 32 S-IIIESP8266 install Arduino IDE 1 in 90 seconds #ESP32Expand Your Arduino Projects with the Mega II: More Memory, More PossibilitiesMastering the Integer Data Type in Arduino: A Comprehensive TutorialHow to Connect an LED to Your Arduino for BeginnerschatGPT API Lesson: A guide for BEGINNERS to do cool stuff with the chatGPT APIPEA Live Show | Mike Buys 6 keyboards, AI & Learning, and ChatGPT API with ArduinoEpisode #08: Intermission: The Process I use for Creating TutorialsBeginner's Guide to Using Potentiometers in Arduino CircuitsDemystifying Arduino Boards: Your Ultimate Guide to MicrocontrollersGrow Your Own Garden Anywhere, Anytime with Hydroponic GardensMastering Keyboard Shortcuts: Highlighting Code on Mac & PCEpisode 04: An Introduction to the Open Source Hardware Group Arduino ShowOmniDrive: How to Improve Accuracy and Motor PerformanceMastering Arduino Functions: Understanding the 4 Essential Code BlocksAutomating Hydroponics with Arduino: Easy Gardening for SuccessBuild Amazing Circuits with Tinkercad: A Step-by-Step Tutorial