Arduino Tutorial 11: Understanding the Arduino Serial Port and Print Commands
HTML-код
- Опубликовано: 4 июл 2019
- You guys can help me out over at Patreon, and that will keep this high quality content coming:
/ paulmcwhorter
In this lesson we show you how to print data to the Serial Monitor using Arduino. We investigate Baud Rate settings and how to get information from the Arduino into your Serial Monitor. Enjoy!
You can get the kit I am using for this series at the following link:
amzn.to/2I7N4Ek
You can get more details on this lesson at our WEB site HERE:
toptechboy.com/arduino-tutori...
[Disclosure of Material Connection: I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. This means if you visit the link and purchase the item, I will receive an affiliate commission. Regardless, I only recommend products or services I use personally and believe will add value to my readers.]
#Arduino - Наука
Maybe an episode on how to make Paul’s Ice Coffee😄
🤣🤣🤣
Yesssssssss
string mess1=“Paul’s Ice Coffee”;
int waitT=500;
Void setup() {
Serial.begin(9600);
}
Void loop() {
Serial.print (mess1);
delay(waitT);
}
@@dannylu6230 You used variables instead of constants!
Paul: You have done well grasshopper. You will soon be ready to leave the monastery.
Coffe in ice...
4 years later and your series is still helping people. New Arduino user here. Yes I am the same with things being tidy and square😂😂 However, we differ in iced coffee vs iced bourbon 😂😂😅 With all seriousness, you have created by far the best series of videos on this topic. Thank you for all your time and effort.
what i like abt this guy is the cool manner in which he teaches. No useless learning but he focuses on understanding! Thanks Paul for being there beside us!🙂😇😇😇😇
agreed
Possibly the best you tube channel ever. Thankyou Paul for giving everyone the ability to turn their imagination into reality.
indeed
I watched you a few years back on your old version of this and was blown away at how good you are at teaching this. I had other things to do for a couple of years (built a recording studio/editing suite by my Mt. cabin in NC and started doing a weekly youtube live stream of old time Gospel Music) and now I'm back into having a bit of time for the arduino since my show is running smoothly now. So, I looked you up and lo and behold, a newer version of you teaching this. Love the electronic "theory" you are throwing in. So, I have been watching your play list on the arduino and have gotten to here rather quickly because it was more of a review for me. But from here on I'm learning. God gives us different gifts. Mine was music, but yours is teaching. If someone can't learn this with you as a teacher, they need to take up something else! Thank you for your efforts. You have been and are, a big help to me and I'm sure to many others. I'm thinking God is quite happy with what you have done with your gift!
Great comment! Send my love to Mt. Mitchell for me! It was my inspiration to move to western Maine. I do miss the western NC mountains though. They are a magical place. Thanks for sharing your story!
nice. best of luck for ahead.
"NO! NO!!" God i love this guy! You are a fantastic teacher!
Thats my favourite part haha
Using variables is not always better than using literals
@@m_t_t_ Maybe Paul covers it in later coding lessons, but I use the pre-processor for things such as pin numbers, min/max range values, etc.
#define bit0_LEDPin 2 // bit 0
#define bit0_Max 1 // 0-1
#define countDelay 200
pinMode( bit0_LEDPin, OUTPUT );
LightLED( bit0_LEDPin, bit0_Max );
delay( countDelay );
I have been going through all the lessons since I got my UNO, I'm really appreciating all of the info, Thanks
I am in depression, your videos helps me handle my conditions. You are a very good teacher. I love to learn new things. Thank for being there.
Check out my attributes of God videos on my Bible Boy channel . . . might help you feel better and understand purpose of life better
An amazing arduino course for beginners. You are a born teacher Paul. you are magician. you make boring staff so exciting.
I am enjoying the series. I usually print the program shown on each lesson and add my own notes for better understanding and future use. Thank you for taking the time to make these lessons on RUclips.
i've watched a few of your old lessons to learn how to write a sketch for lights on my rc police car a few years ago, and was successful, but i didn't quite understand exactly what i was doing with the variables. watching these most excellent new lessons, i am completely grasping the idea behind them. you sir, are a true gift to the art of teaching.
I love those parts where Mr. McWhorter inserted "misses" on working out the program, it strengthens good programming practices and showed mistakes I might myself make so I won't have to. The tutorials have indeed been very exciting and keeps on getting better. Thank you for these great contents Mr. McWhorter. I hope you could do more contents in related areas.
Paul is a national treasure I have never seen anyone that can make teaching so easy. I wish I had a teacher like him when I was in school. I have had some terrible experience because of poor teaching.
Been in the EE game for decades but just now getting into Arduino with my kids. These videos are obviously aimed at electronic novices but have still been an incredibly useful resource for getting me up to speed with the Arduino overall concept, their range of boards, and the ins and outs of the ATmega328/P MCU which I hadn't come across much before I started looking at Arduino as a teaching tool for my kids.
I've been looking at beginner Arduino tutorials all over RUclips for weeks and this series is, in my opinion, head and shoulders above anything else I've seen out there. This is professional grade teaching for free right here. It used to cost us old farts thousands in education fees to get access to this sort of well organised, easy to digest, information dense, content.
Hope you lucky bastards appreciate it.
Excellent job Paul.
Just getting to grips with the Arduino, for a home automation project, and found your you tube channel one of the best. Really easy to understand and love the fact that you give an introduction to the physical working of the various components. Very easy to follow and Excellent all around.
Paul - I just wanted to drop you a quick message to thank you for taking the time to make all of these videos. You’ve done (and are doing) a great job, which many of us appreciate. Thanks!!
yeah im acually learning somthing teaching stuff (besides book) unlike most stuff im really happy that im not board of doing learning stuf
Wow - I'm loving learning again! Paul explains things so well, wished you would have worked at my High School!
I pause your video and just to say your are such a great teacher to me. I do not know only print and println command difference. You show the difference beautifully. Your every class has a twist and turn which really makes video interesting. It helps to learn easily where we set up us and edit our faults. Such a great teacher you are. Thank you very much.
Watching right now, just another great video, thanks Mr. McWhorter!
Really enjoying this new series,,, keep it going and well done, very well explained.
I am watching all 50 of your tutorials. I am a fluent C coder but everything that I know about Arduino comes from watching and listening to you. I want to master Arduino Uno.
Hi ! this is the first time I get an english lesson because I'm french, but I have to say that absolutely everything is cristal clear ! Thanks a lot for this because now I can play again with electronics and software programming like 40 years ago !!!
I am so thankful for those videos. I’m going to do a classtest about arduino. My teacher didn’t explain at all. Now I’m starting to understand it. Thank you very much Paul.
Your lessons have been a Godsend; helping me feel I'm not wasting my time during this Covid lockdown here in the U.K. I'm learning a new set of skills. Thank you.
I just love it so much the extent at which you go to teach us 🤣 When you scream 'no, no!' when we use random numbers in the code is great! I feel like it really drove the point home (at least for me)
Good tutorials, i like how al my middle school knowledge of electricity is being refreshed. Its been so long ago i didnt remember a lot of it. Thx for explaining everything in such great detail!
Thank you so much, now I'm designing my senior design project and these tutorials are really helpful.
This is only lesson 11, but it feels like I have made so much progress already. Thank you Sir! Best wishes from Italy
Excellent!
I felt quite intimidated when my Arduino arrived in the mail and it just sat in a draw for a few weeks. Your videos have really given me confidence and I've begun to grow more comfortable with the Arduino's learning curve. Thanks again!
Great lesson again! Thank you so much, Paul. Used the print command to get something like this on serial monitor:
Voltage across 220 ohm resistor is 1.99
Voltage across 330 ohm resistor is 3.01
Code:
int readpin=A1;
int readVal;
float v1=0;
float v2=0;
int delayT=500;
String line1= "voltage across 220 ohm resistor is " ;
String line2= "voltage across 330 ohm resistor is " ;
void setup()
pinMode(readpin,INPUT);
Serial.begin(9600);
void loop()
readVal=analogRead(readpin);
v1=(5./1023.)*readVal;
v2= 5-v1;
Serial.print(line1);
Serial.println(v1);
Serial.print(line2);
Serial.println(v2);
delay(delayT);
Great work mate!
i really love your way to explain and to prepare us to encounter any kind of mistakes when we are writing the program, thanks a lot Teacher you are the Best best best
I finished this video and immediately went on ahead to create a program that basically prints the answer of a calculation we know as " iterative solution", and all we have to do is insert the equation and starting value, and it prints the answer to each iteration. Thanks Mr. McWhorter.
Very dense learning in this one (#11). The hardest yet for me. Paused often to keep-up with you and re-runed the video at least 3 times to sink it in! Very satisfying to work on the Serial printer though and will try to keep practicing because it could be a very usefull tool. Thanks!
Excellent!
excellent!! thank you!! keep on having your cold coffee. We can smell it from this end!
This was an awesome learning video! I had to watch it several times for it all to sink in. Once applied to my Arduino programming, it was amazing to read out the commands on my laptop. Thank you Paul, you rock as a teacher!!
I am glad I am no the only one i felt thick as hell watching that lol
Thank you Mr. Mcwhorter. I'm picking up what you're laying down :) great lesson!
Thank you very much Mr. Paul Mcworther! I learnt so much!
Paul, along with all the others commenting below. Big thanks. Really enjoying learning this properly. I had been a bit scattered brained about it learning bits here and bits there. This is the real deal !!!!
Another great lesson. I work on the sketch during your lesson, then go back and add comments on every line of the sketch help remember the lesson.
Continuing on my journey through the new and improved arduino tutorials and adding to my "toolbox" every lesson.
Excellent series! Yes! clear understanding. Yes! following along with proper hardware. Keep up the good work and thanks again.
In C++ I was able to print multiple variables at a time, I gave it a try with this ide, low and behold it worked!
example:
String myString=" + ";
int x=10;
int y=10;
int z;
z=x+y;
Serial.println(x+myString+y+" = "+z);
Code for this lesson:
int J=1;
int inDelay=1000;
int x=3;
int y=7;
int z;
String myString=" + ";
String circleA="the area of this circle is ";
float pi=3.14;
float r=2;
float area;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
z=x+y;
area=pi*r*r;
Serial.println(x+myString+y+" = "+z);
Serial.println(circleA+area);
delay(inDelay);
r=r+0.5;
}
You are a great teacher Paul! Enjoy followin along with my elegoo.
i had to follow this through quite a few times but after a little playing around i finally got it. Thanks Paul
Another one under my belt. You forgetting the semicolons is helping me. Again, thanks! I've been shy of programing but I'm getting over it thanks to your courses.
*Sir your students are so lucky*
Love to watch and listen to this over and over again 😊thanks a lot
Another video of yours that has helped me out with my elegoo 2560. Brilliant Work!
I've watched many arduino turorial and this is still my favv. Thankyou Sir for sharing ur knowledge. God bless u
Another action packed video full of great informative content, best one yet, thanks Paul.
I get the feeling you may have been to a funeral or another sad occasion, i kept hearing semi condolences.......made me smile. Thanks again for another valuable lesson. Simon
Thank you for making your lectures so enjoyable, even after only Tutorial 11 I feel like I can write a table using Pythagorean Theorem, but not very quickly though.
I love your videos they’re fun and easy to follow and I can quickly grasp the concept of whatever is being taught : )
Awesome tutorials + chat gpt. I thought Im too old to learn any new complex things, but here i am already on video 11. Thanks to Mr. Mcwhorter for sharing knowledge with us.
Professor, I greatly appreciate the course and its quality. I send you a cordial greeting from Mexico
Thank you very much. Enjoyed the lesson, also it is great that you keep us engaged and show common mistakes. Looking forward to the next lessons!
Thank you so much. I just turned 13 and i know that i will be having it easier than most people in college because of you. ONLY because of you. you are amazing. and you are not even doing it for the money. Thank you. I hope you see this and it makes you happy.
Edit: I succesfully did the homework with help from your video about ohms, voltage and ressistance. I have now saved every equations you taught me. I am so greatfull. That is it from me. Peace out.
i've just seen tutorial 22's thumbnail on the recomendations and i'm so pumped to get from this to something so cool in so little time..
Really enjoying these lessons! Thanks for the education Paul!
Glad you like them!
I’m so glad to see that good videos like these keep getting views years after they are posted.👍
all the new tutorials are awesome
Loved it! You are awesome! Thank you for all the lessons!
Thanx a lot for your explanation! It simple and easily to understand! Appreciate your lessons!!!
Is it just me, or has this dude just jumped to level 100 since the last video?
I agree! I've lost me this time. I thought I may have missed a lesson, but I haven't
Yup, I was doing great until this lesson.
why is it so much harder
I actually can't believe I had to scroll down so far to find someone saying this. Even in the last video I was a bit lost. I was doing one or two tutorials a night until I got to the last video, and since then I was feeling too intimidated to do this one, and waited a week or two. Tonight I decided maybe it will all make sense in the next video, so I got out my Arduino and started lesson 11, only to find out it's even harder than 10, and it doesn't help lesson 10 make any more sense.
In the first 9 lessons, he explained everything very clearly, but now it seems he doesn't explain each thing and what it does so I feel like I'm just copying his code and not understanding what I'm actually writing. Quite disappointing, as everyone else here says that these are the most easy to follow lessons they have come across. Makes me wonder if it's worth continuing.
Glad to know it's not just me who thinks this though.
I’m with you all. I started off so well and then I really started to struggle when the binary came along.
i love his tutorials
cant wait to finish this
Great tutorial, thanks :-) Modifed the code to calculate the long side of a right angel triangle, works perfectly!
3:31 awesomeness overload. Paul Mcwhorter is the best teacher to ever exist.
KEEP SHOWING OFF! GREAT STUFF PAUL!
Thank you mr Paul, verry nice lessons, tnx from Belgium.
You're keeping me up waaaaaay past my bedtime. LOL! Great job!
Superb..! I really enjoy while learning something new in every tutorial..!
great lesson. I was able to point out all your mistakes before you did and I was able to write the code before you did. I do understand this lesson.
Thank you for these tutorials.
This video series is a Great way of teaching Arudino. Thanks Paul.
Glad you think so!
Fantastic job Paul!
While going through the tutorial I didn't want to lose the previous examples so I continued with additional Serial.print and Serial.println lines of code. Took a bit of experimenting but found it possible to print subsequent lines by always ending the last line with a Serial.println command.
The serial monitor returns this;
number = 1
3 + 7 = 10
Circle with radius 0.00 inch(s) has an area of 0.00.
number = 2
3 + 7 = 10
Circle with radius 1.00 inch(s) has an area of 3.14.
number = 3
3 + 7 = 10
Circle with radius 2.00 inch(s) has an area of 12.56.
Thanks, Paul. I learned something new today 😇
Best teacher of Arduino lecture
best arduino course on the internet right now. Thank you ❤❤
McWhorter; you are doing a pretty good Job. Thanks a LOT!👏
Great videos! Thanks for teaching in such an amazing way. Was I the only one who was disappointed about not getting a homework assignment in this tutorial?
This one was fun, quite simple and enjoyable!
Another excellent video Paul!
Thanks for watching
YOU ARE THE BEST, Paul.
Great as always! Thank you
Thank you, Paul! After this video, I made a Fibonacci Series generator, and it works!
Wonderful and captivating teaching, you are fantastic :)
Nice and intuitive explanation.
I have pressed the red little bell icon😀..awesome videos..turning me into a complete engineering
Thank you, Paul! Another top notch lesson 😁✌
Glad you liked it!
Awesome lesson!
Ah, now this is one thing I have been waiting for. A bit on how to format printing. It isnt too different from what I am used to, and it is the syntax that I need to learn. I remember pulling my hair out back in the old DOS days when we needed print forms using MS Basic. We always had lots and lots of formatting errors until they were all weeded out. ugh. Thanks again for another great video and I am looking forward to the next lesson
Liking these tutorials 👍 so much that I am slightly disappointed when there is no homework assignment.... After this one, I did calculations and printed the diameter and circumference in addition to area.
I noticed that writing the formula first before printing it kinda gives us a peace of mind.
Peace of mind that we know the formula is already executed...
then the thing only left to do is to print it.
On another note, it is logical to write the increment formula at the last line
so that when the code loops, the incrementing variable automatically has a new overwritten value.
Thank you Sir Paul!
Man Thank you so much I love your videos they are amazing I will catch every video on your chanal I even have a notebook to write everything that you are explaining
As a retired electronics engineer, I enjoy your sessions.
love from india , your are the best arduino teacher on youtube .
once again kind ties the Python also what I'm learning all good things !!! great job
Hello, Paul, I did notice the lack of semicolons. You are training us well! Cheers!
Finally figured out how to comment. Great series and the starter kit is awesome. Boom!
Very informative video,thanks sir.