Это видео недоступно.
Сожалеем об этом.
Arduino Tutorial 13: Understanding Arduino If Statements
HTML-код
- Опубликовано: 10 июл 2019
- You guys can help me out over at Patreon, and that will keep this high quality content coming:
/ paulmcwhorter
In this lesson we investigate use of IF statements in a practical arduino project example. We will read a voltage from a potentiometer, and then turn an LED on if the voltage is above 4 volts. We will learn the different conditional commands in the IF statement.
You can get the following Elegoo kit, to follow these lessons and play along at home
amzn.to/3c9SJrO
You can get more great arduino content on our WEB site. Link to this lesson:
toptechboy.com...
[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
I am a 70 year old retired electronics tech. I am thoroughly enjoying this series. I build every circuit and write the code. Thank you for doing this.
I'm 72 and retired from the Semiconductor Manufacturing Industry as an Engineer/Manager. I'm having a great time with this.
.....and I am a 70 year "old" architect in Norway. I have a model railway under construction where I am going to use Arduino to control various functions. I think Paul makes a wonderful job with his tutorials.
I'm a 66 year old retired engineering tech that worked in the semiconductor manufacturing industry. I can troubleshoot electronics down to the component level and can build anything using solid state devices or vacuum tubes but software has always been a weakness. I know the basics of Basic and C++ but this series has been a great stepping stone for filling in some of the holes in my software knowledge.
Thanks for the lesson. Hot my homework done.
I love this series and I'm only ten
Hi Paul, please keep these videos coming. I'm an 81 year old beginner in the UK and I'm enjoying your lessons and actually learning. I love and need your emphasis on the important points and their repetition as it slowly sinks in. Thanks again.
Sammy Jackson hi Sammy glad that you keep finding new knowledge.
Hey Paul,
You are not talking to a wall , I am following every single step carefully and I complete all your assignments. Thanks for introducing us to Arduino in such a simple way and that too free of cost. Your selfless efforts will always be noticed. Thank You Sir.
Over three years later and you're still being heard. Thank you so much for being a great teacher. On to lesson 14!
My pleasure!
Hi Paul, you are one of the few RUclipsrs that is a quality educator!! Thanks so much!!
Agree
Absolutely and well said Mark
i only learn from afew learning channels
Hi, Paul.I am 80 years old. I have worked with computers and electronics almost all my life. I have also served as a "tentmaker" minister all my life. I have been retired for almost 20yrs and wanted a hobby that would stimulate my mind. I settled on the Raspberry Pi and the Arduino. I already understand the electronics and can program in ASM, BASIC, FORTRAN, C++, and Python. I am still going through each lesson because I enjoy your style of teaching. Thanks for continuing to stimulate my mind.
3 years later and still not talking to a wall! I am taking notes throughout each of your lessons and playing around with the assignments. You are a fantastic teacher. I work with children and want to teach myself and them about circuitry/robotics. I have experience working with web design but this course is by far the most fun I’ve had with anything programming/computer related. The tactile part of circuitry is really gratifying, and your way of slowing down to REALLY explain some of the physics is awesome.
Couldn't agree more! These projects are fantastic and Paul is an amazing teacher truly.
I'm 21 electronic engineering student and I'm enjoying the tutorials. I have covered the previous 11 Lessons and am determined to go through the whole Playlist!
Best of luck!
I am 14 years old and I am learning programing from your lecture thank you stay blessed
Me to! ive been following all of the code, and even making my own quadruple checked projects, and I dont even have my arduino yet! its sad when amazon doesnt ship one day lol
I am a 77 year old retired US Navy Missile Technician Chief Petty Officer. Served on four FBM submarines. Just started dabbling in Arduino. Looked at a lot of RUclipsrs trying to explain Arduino. Most not cutting it in my book. Your approach to teaching the "voodoo" involved in making an Arduino work is excellent. The "Old Guy" is actually starting to learn some of the "voodoo". Just finished lesson 13. Great work. Looking forward to the rest . . . .
I just finished my Computer Science degree with specialization in Data Science. A friend who teaches Arduino classes in High School told me about the wonders of Arduino Microcontrollers. I found your tutorials on RUclips and This is my hobby for the Summer. I never fast forward any part of your videos even though I am proficient in C++ and Computer Engineering, because your pedagogy is just mesmerizing ! Congratulations Paul for your course, you really are a hidden gem in the world of teaching Basic Computer Science courses.
I’m a 55 year old mechanical/hydraulic engineer, I do all the circuits, code and homework. I’m loving these tutorials! I have some uses for the Arduino to integrate into my home automation setup, I could just copy and paste other people’s projects from the internet but I really want to learn how to do it myself and these tutorials are excellent. Please keep up the good work!
I'm a former heavy duty mechanic for 27 years myself. Electronics was just a hobby of mine, but I'm looking to make it something more of it and pursue my dream career and be self employed.
You are not just "talking to the wall" as you put it. I am listening and doing the assignments that you suggest each time. I love it. The home work is not too hard. Keep up the good work.
"AH! HAPPY HAPPY BOOM!" from now on, I'll be saying this each time I succeed in anything.
I want the t-shirt that says..Serial.println "AH! HAPPY HAPPY BOOM!";
Senior in high school. This series has mind blown me with the amount of knowledge you make easier to understand for about anyone thank you. I have had very little to no confusion this far
Perhaps there is an engineering career in your future? I say go for it!
Hi Paul,
One time programmer, in the good old days. Really enjoying this series, and your style of delivery is just right for me. Having spent many years as a teacher in front of a class of people, I am continually impressed with your ability to treat the camera (s?) as a live audience, I assume that you are alone !
Pace is great, as are the occasional pauses to sort out mistakes. You are one of a select group of utube educationalists who make learning both entertaining and challenging, avoiding tricks and showbiz .... I salute you all!!!
As a retired electronics tech who has never used an Arduino and is starting a new hobby your videos have been invaluable.
The basics are second nature to me but the programming is where I am learning a great deal. Thank you for the new series and keep up the good work
3D Home Brew same here for me, I parked Electronics in 1980 when I started flying airplanes for living. Paul does a great job.
Hello Paul, I'm an 18 year old student from Spain and just wanted to say that I really enjoy and learn a lot of your tutorials.
Hi Paul, I'm a 56 year old electronics technician and radio engineer from New Zealand who realized I needed to embrace the digital era and have found your lessons most helpful. This one was especially useful with the details on how to specify and, or, equal to, not equal to etc. Thank you for creating this content!
I 'm just getting started with Arduino and couldn't of asked for a better teacher. Your tutorials have helped out tremendously. Thank you very much.
All one needs to understand and truly learn things is a passionate teacher. So glad i found you Paul!
I am watching your videos avidly Paul,and doing the homework, and so are many others. You have a real gift for teaching!
Hey Paul...absolutely NOT talking to the wall! Your series is here for all and forever so thank you...discovered this gem > 2 (?>>2) years later!
I am 13 years old and I love your videos. your videos are extremely easy to follow unlike other youtubers. If I was to describe your videos in one word I would use the word addictive once I start watching I can never stop. massive thanks to you for doing what you do
I love how satisfied you get when simple programmes works even still after years of doing this.
I am a 68 year old lady that has always been interested in electronics but didn't know where to start.
Became a licensed ham 2013 felt i need some understanding of electronics so am a total newbie. NW7Z
Cheryl Freese 73 de KA1DNO
Hi Cheryl, im also 68. Im on short term disability, and using the time to learn more about my Arduino, and also my ham technician's license.
Hello Cheryl. 66 years old here and have been into electronics most of my life. Welcome to the fun world of electronics. KE6UDT here.
You're not talking to a wall. This has been the most helpful and engaging Arduino tutorial series I've watched. It's been a tremendous help for me and my projects.
I'm Lucas from Brazil and i'm here to thank you for all those great content that you've made for us for free, you are a high level teacher and a incredible person, greetings from Aracaju,SE (Brazil)
Yes I am 60 in August and have been following you for just a few months and can actually do simple sketches for Arduino due to your clear simple explanations. So satisfying achieving even the simplest of projects and no I will not be drinking coffee on my birthday. Big steak and Beer :-)) Thanks and keep them coming, respect and thanks.
happy birthday!
Happy birthday ^ ^
Hi from Australia. Love this series. I always wanted to get into robotics and programming controllers. I am following along and doing all the assignments so far. From a complete novice I find this challenging, but understandable. You are a good teacher.
Thank you. God Bless
Welcome aboard!
Hey Paul , im a final year engineering student from India and you're really helping me to learn something new here , thanks a lot for this whole series man!
I was in night classes to learn electronics and automation. I started following your lessons and they're much better than the classes I was paying through the nose for, so I quit and now joined your Patreon. I take full notes, save all IDE programs, build every circuit, and go through all the homework. Thanks for such a wonderful learning experience. I enjoy everything on your channel except your awful coffee.
Hi Paul, I'm newish to Arduino and new to your videos. Love the format and I do build the circuits. I also do the homework. It's great that you do not edit out mistakes from the lessons. Great way to learn debug processes.
Hi love from INDIA ❤️
I am enjoying this series in lockdown
Hope this pandemic ends soon
Paul Thank you for being here I am 79 and i am teaching Arduino to 5th grade thru 12th grade. we started using your videos. you put so much effort into then I would have the students love the way you teach I am to go through
so much faster. Thank you for your help God bless.
I am a 64 year old retiree from the chemical industry. In college I majored in electrical engineering technology, but spent most of my career in power distribution and project management. At one time I programed PLC’s and enjoyed it. So to keep my brain function going in my retirement years, I decided to take up programming micro controllers like the Arduino. I purchased the kit, then discovered your video series. Love it. You do a great job explaining things. I build each of the projects as you explain them and do all of the homework which really helps me trouble shooting my programs. Of course my goal is to finish your series then do something useful with the arduino. Thank you so much for doing this series. Always looking forward to my next lesson.
I'm really enjoying your lessons. This is a good example of how software can replace hardware and reduce overall complexity. Your lessons are on the mark. Keep up the good work.
Another great lesson! Starting to write code before you do based on your instructions and finding code errors as they are typed in. Both yours and mine. Keep up the good work. I've learned a lot and can't wait for more.
Done the assignment with 5 LEDs. 1 LED using IF statement and 4 LEDs using AND, OR statement in a single program. Thanks a lot for easy to understand tutorials.
Great 👍
Hello, Paul. You were wondering whether anyone was watching your presentations and doing the homework. Well, I have just finished the homework. My potentiometer was a bit wobbly, so I had to reposition it. Then my logic was a little off. Finally, I wrote a v2 instead of a V2. All in all, very instructive. I think it took me about 45 minutes to complete. Thanks for the presentations. They are great.
Yes! I am doing these projects and homework! I have done a quiet some of the old Arduino videos, and am doing these as kind of a review. You certainly aren't talking to a wall!
That BOOM BOOM call wakes me up while watching at midnight😆😆😆
I'm a 53 yo with a strong background in electronics and BASIC programming. I have no experience with Arduino or C++ programming. I've been wanting an Arduino starter kit for some time now. I got in on a lightning deal for an Arduino starter kit (not the Elegoo kit, sadly) and I've been watching your videos as a refresher to electronic circuits and a primer to Arduino and Arduino programming. I, like you, want an electron/bit-level understanding of what's going on with things so I appreciate your in-depth approach. When my starter kit arrives in a couple of days I'll be ready to take it out of the package and immediately start building and programming. I've even gone ahead and installed the Arduino IDE. Thank you for giving me a solid start.
Used to be an Aircraft Maintenance Engineer and always wanted to learn how to program things and you make learning how to program this board easy. I think I found my new passion. Thank you for making these videos!
Great to hear!
Paul still looks so nice and smart, even when his program has a bug in real time. We support you, Paul!!! We appreciate it!
You sir, are an excellent teacher. I like that if something doesn’t work, you talk through your troubleshooting steps. Really helpful, thank you.
this is LITERALLY the BEST tutorial i've ever seen! Im 14 and my parents got me the complete starter kit and IM KICKING IT! thank you Mr. Paul McWhorter!
64 year old retired automotive instructor. Having a great time. Doing all of the homework and enjoying it.
Hi Paul
, from Antwerp, Belgium.
I've always wanted to do electronics. Programming is also added with Arduino. A double profit! My 62-year-old brain crackles sometimes, but it is ok thanks to your very expert explanation. Big thanks !!
I've been sitting on this series since I got my Elegoo in December and finally have a time to watch it. I'm obsessed. I even woke up early to have my coffee and watch the next tutorial.
I did want to know if you have a cheat sheet in the binder and/or whats inside it?
Hey Zack why'd you stop posting after the Color Reel 2017?
Just to let you know I'm still watching and learning! I'm a 59 year old electrical engineer doing this as a hobby - Great tutorials and plenty more to go!
That is awesome!
I'm still watching, and have now watched and completed 13 tutorials in 2 days, including the homework assignments
Thank you very much, certainly no walls! Please keep on inspiring the world as in your other channels
Paul, I really appreciate the way you teach these Arduino lessons! Thank you for this channel
My pleasure!
Love your tutorials! Retired USAF ACFT mechanic going back to school for BS in ECE. Hands on learning is the best!
That is awesome!
Hi Paul, Really like this tutorials of yours. I am a 67 years old guy from Sweden and you make me look forward to every lesson. I have bought Elegloo´s "The Most Complete Starter Kit- UNO R3 Project" and I want to learn all the basics. I have some ideas what to do later on, but I have to understand all the magic when I learn how to set up the items and how to write the code so something wonderfull will happen. Arduino 2.0 is a little bit different than earlier versions, but that is not a big deal. However I have some problems today to understand the IF statements, so I have to work more with "and", "or" and all that stuff later on. I really look forward to work with tutorial number 14. Well, my hot choclate is also refreshing. Thank you Paul!
If the teacher makes mistakes (sometimes), and stumbles - its actually then when learning really happends! Good job:-)
😄 if you don't make mistakes you never learn how not to do things and you would never really know why it is important to do things the correct way.
happens*
Teaching is the ultimate learning experience. Students will ask questions you never thought to ask making you think about it in different ways.
*Yes, been looking for your new video this week!!!!*
I am a 69 year old retiree who has worked in the electrical industry for the past 42 years and greatly enjoying these videos and yes, I am doing the lessons assigned. Thank you for the very informative videos.
I started writing Fortran code in 1966 and now occasionally use C# and Minitab's Macro coding language with if's, while, do loops etc. I remember acing my Electrical Engineering DC electronics class, then when faced with AC switched to Chemical Engineering. Have always used programming of some sort throughout the years. The combination of theory and hands on assembly and coding is very exciting and I'm enjoying it thoroughly . I successfully extended the homework to print different messages within each region, green - Safe Zone 0 to 4 volts, Yellow - Warning Zone 4 to 4.5 volts, Solid Red - Early Warning Zone 4.5 to 4.75 volts, and finally Blinking Red - Late Danger Zone greater than 4.75 volts.
Thanks again for your great lessons.
Your videos are very helpful thank you......
.....sir how much time will it take to complete this series
I keep adding more videos but just release two a week.
First! thank you very much for your videos!
I get great value watching you debug code when it doesn't do as you expect. Your debugging thinking is a whole other learning experience in addition to whatever else you are teaching.
It appears from the comments that you have as many "more experienced" viewers as kids. Ahh when rocks were soft, good times.
Teaching a kid, child's play. Teaching old dogs... Master Paul I salute you!
Hey! Who you calling old? :)
Does anyone actually make the ice coffee? I’m tempted to try it 😂
Had my first cup on video Tutorial 12. It was nothing less than most amazing. Ice no sugar.
nah, I make a pot of Yorkshire Tea! This sees me through 2/3lectures at a time ;)
Paul does have hot coffee in cold weather I've noticed :O)
Hallo Mr McWhorter, I'm a 69 y old medic and I'm enjoying your lessons, especially when You give background notions. Beside the practical aspect I like also the theory behind. Thank You
Cool, thanks
Hello Paul, Thanks for the wonderful lesson... I have successfully completed my homework of making a 3 LED indicator as follows:
1. 0 - 3V --- Green LED
2. 3.1 - 4V --- Yellow LED
3. 4.1 - 5V --- Red LED
Dear Paul, you are talking to many of us, i am taking keen interest to watch these lessons.. your way of teaching is so good, that's why i use to watch these lessons instead of wasting time on fb... great effor.. keep it up sir...
I spent an hour trying to find out why my red LED circuit wasn't working. Test the LED, test the arduino leads, switch leads around. Is the pot working? Go out to my shop and get my Fluke which I trust completely. All are working as they should. Finally found a period where a comma should be in the pinMode output for the LED. What fun! Love this stuff. It's a super thing you're doing giving this free course. Have a coffee.
Called Troubleshooting. No fun at the time, but wonderful joy when you find the problem.
I'm having a lot of fun with these projects, especially seeing different pieces come together as part of the whole. Thank you for making these lessons and demonstrations!
Glad you like them!
Hi Paul. I am a big fan of your videos. I am 22 years old and studying business economics, and I live in Brussels (Belgium). But I have a great passion for electronics and I just want to say thank you! May God bless you in various ways, both in this world and in the hereafter.
Fantastic!
I did it!!! I am referring to the homework regarding the 'IF' statements. It was a great challenge that I needed in which to build upon even more challenges. There were errors made and one was a struggle to determine if it was my coding or my breadboard circuit . After hours of rewriting the code and rewiring the breadboard many times and with a "strong dose" of persistence, I found the error. It simply involved turning on the yellow LED 'IF' statement correctly and then using exactly the same 'IF' statement to turn the the led off. So, I believe the LED never had a chance of lighting-up. Thanks for the challenge... I will not forget this in the future.
Thank you so much for your tutorial Mr. McWhorter! I follow along with all your lessons and homework and keep notebook full of notes. I am 38 years old and am attending college for automation and electronics because it has always been an area of great interest to me. I appreciate what you do and I will be right here with you as long as you continue to put out these tutorials. God bless you
Great job!
I love how you take us by the hand and walk us through every step. To many people out there saying "Learn it here" have forgotten how much they know and don't pass along steps that essential to us Noobs, so we get lost almost Immediately. You are great at covering the basics essential to us. I'm learning and loving it.
I am 68 years old and started dabbling in electronics after retirement with a view to getting my grandchildren interested in the 4th Industrial Revolution. So enjoying these lectures. Managed to do the homework and have my green, yellow and red LED's coming on and off at the designated voltages. If I had teachers during my school days with your capabilities Paul, I am sure my career path would have been very different.
I've been watching your new series here from the beginning and following along, no coding experience.
Thank you so much Paul I'm understanding and getting it and it feels empowering, god bless you and your kin you've opened me up to an entire new world. I'm 39 years old truck diagnostics and automotive electrical technician in Israel and now I'm diving into coding that'll be applicable to all these different requests from customers such as a warning buzzer if an engine overheats and things like that, so thank you Paul may God give you many more healthy blissful years. You the man.
Really good that you make deep dives into how it works. And when you make some mistakes even more I learn. I am 65 years old and have always been interested in this but never worked with it. THANKS
I am on furlough and only working a few days per week. So I have been watching as many as I can and following along. Thanks for the info!
Still watching and learning a ton in my 50s in 2021. Electronics never clicked in High School but now it's coming easy. Great teaching method.
That is awesome!
You are one of the 3 teachers/doctors that keep me awake during their lessons 😂😂 huge thanks ❤❤ May my god guide you 🤲
71 year old Brit here, thank you for a fantastic set of tutorials Paul, brilliantly presented and easy to follow. I particularly like the way each one builds on its predecessor. Keep up the good work!
Nope, you aren't just talking - I love doing your assignments - and its been over 3 years since you posted the video. Great job yet again!
I appreciate that!
I'm 72 years young! I was once a technician and Engineer working on manufacturing modems ,computer memory boards and power supplies. I am really enjoying remembering these circuits and programming skills. Thanks! Manny from Puerto Rico
Hey Mr.Paul
It’s been 4 years now, since this is tutorial began, 13 lessons, I had carefully watching step-by-step your words and actions.
For you , Paul, it wasn’t a waste of time, never, and that for us too, thank you from the deep of my heart ♥️
First year EE student here, loving these lessons so far!
Started watching the R 4 WiFi tutorials. Was happy that you still have these videos up since I am currently working with an R3 UNO.
im a 19 year old engineering student and i am really enjoying this course and definitely learnt a lot .. Thank youu for this
I don't normally comment on RUclips videos, however I wanted to let you know that you are still helping people learn like me how to code and wire Arduinos 4 years after your video came out. Thank you.
I'm sorry it was three years ago. I have to have you set to 1.5 speed but you're very good. I feel like you're aiming it at me. 50 year old that should have gotten into this years ago. I hope the upvotes, comments, subscription etc... are still going to good use. Thank you for taking the time
70 year old started out as programmer and software designer. You make it so easy to stick with you to the end. Assignments have a good level of difficulty
Dear Mr. McWorther. I have been watching your videos and they refresh my knowledge in coding and circuitry. My old hobby has been revived. Thank you very much.
Excellent
@@paulmcwhorter This is my assignment, just had the time to do it :)
int outPin = A2;
int baca;
float voltase;
int jeda = 500;
int redLED = 8;
int yelLED = 9;
int grnLED = 10;
void setup() {
Serial.begin(9600);
pinMode(outPin,INPUT);
pinMode(redLED,OUTPUT);
pinMode(yelLED,OUTPUT);
pinMode(grnLED,OUTPUT);
}
void loop() {
baca=analogRead(outPin);
voltase=(5./1023.)*baca;
Serial.print("Current voltage is ");
Serial.print(voltase);
Serial.println(" volts");
if (voltase>=4.0) {
digitalWrite(redLED,HIGH);
digitalWrite(yelLED,LOW);
digitalWrite(grnLED,LOW);
Serial.println("MAXIMUM VOLTAGE RANGE");
delay(jeda);
}
if (voltase>=3.0 && voltase=0.1 && voltase
I'm glad my == "if" statement worked for me the first time. I thought I had exactly the same as yours, but turned out I didn't make the same mistake you did. It shows me that I'm not just copying you and I'm actually learning.
To be clear, the most important lessons I usually learn from your videos are when you end up debugging your own work. I'm learning all of this for the first time so seeing how to troubleshoot and diagnose problems with the code is what has made it possible for me to not rage quit when it stops working and I don't know what to do.
Great to hear!
I am Brazilian and i am learning everyday with help the subtitles every circuit, thank you so much.
That's great!
your videos are amazing, and the fact that there is like 68 videos explaining everything that you might want to know when starting up is fantastic, I really enjoy the series as I have just purchased my own Arduino starter kit and didn't know where to start
I do all the homework. I pay attention during the lessons. I look forward to the lessons. I am sad when they are over, except that I can start the next one.
Thank you!
Hi Paul
At about 18:00 min into your lecture you told us about the curly brackets in the if statement and i saw a little homework for me to do. Turns out that if you press enter after you open the curly brackets, then the program enters the second curly bracket automatically as opposed to you moving your cursor with the mouse to the line below (then you will have to put in the curly bracket yourself). Also I love it when you purposely make mistakes, it keeps us all sharp to syntax.
Good stuff Paul. Thoroughly enjoying it. 54 mechanical engineer here looking to learn a little about other engineering disciplines
Never found a better Arduino course than yours Sir, and ill finish them all ;)