Arduino Basics 102: Control Structures, Variables, Interrupts

Ғылым және технология

Support me for more videos: / greatscott
Previous video: • DIY Portable LED Panel...
Arduino Basics 101: • Arduino Basics 101: Ha...
Facebook: / greatscottlab
Twitter: / greatscottlab
You can get Arduino boards here (affiliate links):
Aliexpress:
Arduino Uno: s.click.aliexpress.com/e/_dT2...
Arduino Nano: s.click.aliexpress.com/e/_dUL...
Arduino Pro Mini: s.click.aliexpress.com/e/_d62...
FTDI board: s.click.aliexpress.com/e/_dV4...
Ebay:
Arduino Uno: rover.ebay.com/rover/1/711-532...
Arduino Nano: rover.ebay.com/rover/1/711-532...
Arduino Pro Mini: rover.ebay.com/rover/1/711-532...
FTDI board: rover.ebay.com/rover/1/711-532...
Amazon.de:
Arduino Uno: amzn.to/2ljDLFL
Arduino Nano: amzn.to/2ljnq3J
Arduino Pro Mini: amzn.to/2kMv0ly
FTDI board: amzn.to/2ljvuRY
In this second epsiode of the Arduino Basics video series I will talk about control structures like if, for, while and switch and how to use them in combination with variables to create more advanced code. At the end I will also talk about why interrupts are so important and how to use them as well.
Music:
In the Hall of the Mountain King, Kevin MacLeod
Ecstatic Wave, Jens Kiilstofte
machinimasound.com/music

Пікірлер: 421

  • @Nerdforge
    @Nerdforge7 жыл бұрын

    Arguably one of the best thorough introductions to Arduino I have seen. I like the parts where you include "why use a microcontroller" and not a circuit for specific uses. With a computer science background it's hard to not always use a microcontroller, but many times it seems like it can be obsoleted.

  • @greatscottlab

    @greatscottlab

    7 жыл бұрын

    I am glad you liked it. Looking forward to your next projects ;-)

  • @mj2068

    @mj2068

    3 жыл бұрын

    well said. but, "obsoleted"?, you mean overkill, huh? xD... (btw, love martina's mythical purple hair)

  • @gautampassi3863
    @gautampassi38637 жыл бұрын

    Can you continue this Arduino series? The way you present stuff is really interesting, fun and makes really easy to understand the stuff. PS great video.

  • @greatscottlab

    @greatscottlab

    7 жыл бұрын

    It will continue if there are enough people who watch it.

  • @iMsMs

    @iMsMs

    7 жыл бұрын

    There are! please keep them up

  • @gautampassi3863

    @gautampassi3863

    7 жыл бұрын

    Yes there are and will be, just please keep the great work.

  • @empb50

    @empb50

    7 жыл бұрын

    Gautam Passi agree 👌👌

  • @lexaf7578

    @lexaf7578

    7 жыл бұрын

    yeah pls its rly nice to watch

  • @JariOrSomething
    @JariOrSomething7 жыл бұрын

    As a developer and i already know these things, i love it. Scott you make great tutorials for people to understand the basics. The things you explain works for a lot of programming languages! keep it going man!

  • @harisijaz946
    @harisijaz9467 жыл бұрын

    I used arduino uno before but now i am able to write small codes of my own . I love all your videos but arduino basic series is excellent. Keep it up and waiting for Arduino Basic 103 :-)

  • @connormitchell9837
    @connormitchell98372 жыл бұрын

    These have been some of the best and most informative videos I've found on Arduino "basics." In tandem with your electronics basics videos, I've been able to connect my previous knowledge of basic electrical circuits with the more nuanced languages of programming. Thank you so much!

  • @TheHandsomeRyan
    @TheHandsomeRyan5 жыл бұрын

    I learned more about reading and writing arduino programs in 7:37 than I have from hours of watching other tutorials. Thank you!!!

  • @asgaines
    @asgaines7 жыл бұрын

    Fantastic! Somehow, despite having been playing around with Arduinos for years, I've never encountered interrupts! Great information, GreatScott

  • @brucewoods9377
    @brucewoods93777 жыл бұрын

    GreatScott this is Great Stuff. I am new to Arduino (only a couple of days old) and your presentation makes it so EASY to understand. You don't get side tracked in your explanations and start running off with some complicated stuff. Love the way you use the "KISS" principal. I need it like that.

  • @georgetroulis
    @georgetroulis7 жыл бұрын

    Lots of information packed into a single video, excellent learning resource. As always, keep up the good work :)

  • @theZ3r0CooL
    @theZ3r0CooL7 жыл бұрын

    Awesome videos! I like that you keep tutorials very beginner friendly; even explaining operators and array indexes as you go along, in a thorough yet quick and simple way. Very efficient and enjoyable videos.

  • @naboulsikhalid7763
    @naboulsikhalid77632 жыл бұрын

    I don't understand why you are still under rated. Man, your things are high quality and quantity in term of info and demos. Thank you very much(it's not enough)

  • @azyfloof
    @azyfloof7 жыл бұрын

    Loving these Scott! Lots of great tips, keep em coming, they're valuable to people learning arduino such as myself :D

  • @raphael9485
    @raphael94857 жыл бұрын

    This series is really good, I'm learning a lot with it, thank you ! I love your channel!

  • @chillzwinter
    @chillzwinter7 жыл бұрын

    I ordered my Arduino. Now I can't wait to get it so I can follow these tutorials.

  • @BluehawkOne
    @BluehawkOne7 жыл бұрын

    This was very helpful. Please consider making a whole series of videos like this.

  • @asadkhan7441
    @asadkhan74417 жыл бұрын

    I think this is the only diy electronics channel which is this awesome

  • @tdtrecordsmusic
    @tdtrecordsmusic7 жыл бұрын

    Thanks for keeping a good pace !! Also, for touching on the more advanced. There is soooo much beginner stuff its difficult to find tips/tricks/unknowns which end up being necessary for completing real projects !! Yes go farther !! We are smart, we can keep up !!

  • @joseneves4273
    @joseneves42737 жыл бұрын

    Scott, this was the best video about this content I have seen!!! Thanks!

  • @aniketakabir1572
    @aniketakabir15727 жыл бұрын

    will be anticipating arduino 103. Keep up the good work

  • @ozgemmo3445
    @ozgemmo34457 жыл бұрын

    Mate, great arduino coding videos - looking forward to seeing 03! Not having done any formal "C" or other language coding whatsoever, you are helping to demystify this fundamental area of using Arduino based projects. Keep up the great work. Cheers from DownUnder.

  • @Rckeeps
    @Rckeeps7 жыл бұрын

    Holy crap! After 1.5 years of java, and 4 months with arduino, i was pretty comfortable with basic arduino programming, but I've never heard of Attached Interrupts! Wasn't even gonna watch this video, but decided to anyways. I learn something in every video of yours. Thank you so much!

  • @sallanmega1
    @sallanmega17 жыл бұрын

    Great video! Please continue this series, I love it

  • @poorlycalculated
    @poorlycalculated7 жыл бұрын

    I really am appreciating this series! Thank you so much for making this series and giving me more things to learn about! I am a complete and utter noob at programming with arduino. Hopefully, you will progressively get to more complicated things in the world of coding and I will be able to learn from it! Keep up your good work.

  • @Dygear
    @Dygear4 жыл бұрын

    That was a very concise explanation of interrupts.

  • @lenn8432
    @lenn84327 жыл бұрын

    Great video! You should definintely continue this series

  • @liutas1245
    @liutas12457 жыл бұрын

    Continue Arduino series !!! :))) You explain things better than anyone else that I know or than I saw on youtube :) Big thumbs up !

  • @luqmankhan-ym4gx
    @luqmankhan-ym4gx6 жыл бұрын

    wow. hands down best electronic tutoriols on youtube. proud of you buddy. grüße aus frankfurt

  • @paulfaugeras4858
    @paulfaugeras48587 жыл бұрын

    Thank you SOO much for those tutorials ! I personally have started coding on Arduino about 6 months ago for a study project : a PID-controlled drone arm with a brushless motor and an accelerometer. If only I had those videos before, it would have been much easier... But now it works, and I learnt the hard way, which is, to my taste, more rewarding, but much slower... Anyways, thanks again, and I can't wait to see the future episodes !

  • @adigunawibi
    @adigunawibi7 жыл бұрын

    i love this type of video, my teacher did not teach me quiet well.

  • @jimbobillybob1959
    @jimbobillybob19597 жыл бұрын

    Always learn something new. Great video series!

  • @horrorhotel1999
    @horrorhotel19997 жыл бұрын

    i pretty much agree with everyone else : these videos are incredibly well made, and really bring across the content- obviously you nedd to get basic electronics in order to get them, but the way you explain the software end of things is really remarkeable - please continue this series, i could really see them becoming immensely popular if someone mentions them in the right reddit or so

  • @dylanwillms1275
    @dylanwillms12757 жыл бұрын

    The way you explain things is Great after folowing your channel for almost 1 year i learned a lot please keep uploading videos

  • @greatscottlab

    @greatscottlab

    7 жыл бұрын

    Thanks for the feedback :-) I will try to keep it up

  • @dylanwillms1275

    @dylanwillms1275

    7 жыл бұрын

    Nice !

  • @Richie_
    @Richie_2 жыл бұрын

    Great video, Great Scott.

  • @Anonymous-qx5uk
    @Anonymous-qx5uk7 жыл бұрын

    C++ Programing Basics with GreatScott , good one mate!

  • @can.iman.
    @can.iman.7 жыл бұрын

    I really would like to see more arduino basics!!

  • @brad855
    @brad8557 жыл бұрын

    great video, makes me want to start playing around with my ardunio uno again, keep up the good work.

  • @bocmanisbertrups9292
    @bocmanisbertrups92927 жыл бұрын

    This video explained me alot of things about arduino! Awesome video! I'm already waiting for the next part! :)

  • @RishabhMutha
    @RishabhMutha7 жыл бұрын

    wow! its much easier than I thought! thanks scott!

  • @MaxCamacho
    @MaxCamacho7 жыл бұрын

    Great Scott!! I have no clue what you are doing but it sure is fascinating!!

  • @Jono6671
    @Jono66717 жыл бұрын

    you are a legend bro, keep up the hard work!!

  • @enduser6957
    @enduser69577 жыл бұрын

    I liked how you kept drilling in until a controller was required...Liked!

  • @topten7064
    @topten70644 жыл бұрын

    Your voice , information & you are great

  • @Emtron_Technologies
    @Emtron_Technologies7 жыл бұрын

    Very Nice tutorial for beginners. Your putting much effort get the episode consistently with great content. And While statement is just a fancy for loop.

  • @rehaanahmed8694
    @rehaanahmed86947 жыл бұрын

    great tutorial ... great job greatscott...

  • @Dogeek
    @Dogeek7 жыл бұрын

    I love your arduino videos, they're so helpful if I don't remember how to do something. If you could add a menu at the beggining in the form of clickable annotations, that'd be awesome !

  • @WayneMcNab
    @WayneMcNab Жыл бұрын

    As usual, your explanation is great! However, I did find it a bit fast to for just learning this subject. Keep up the great work

  • @FadiFadi00
    @FadiFadi007 жыл бұрын

    Great work, I already knew that but i enjoy watching your videos 😊 Waiting for your next video 😄

  • @yaminyassin3602
    @yaminyassin36026 жыл бұрын

    love your handwriting! :D

  • @power-max
    @power-max7 жыл бұрын

    Make sure to cover bit masking, direct port manipulation, bit shifting, pointers and stuff! These are advanced things that are hard to learn about without taking an embedded class!

  • @stefanbramel
    @stefanbramel7 жыл бұрын

    I already bought myself an Arduino to play around with it and it's great. :)

  • @stevemorse5052
    @stevemorse50527 жыл бұрын

    I have just watched Arduino 101. I have been using Arduinos for many years, love the platform. So as I watched your 101 video, I was surprised to find out something I did not know. Danke Schön (It was the value or, and how to use the internal pull up resistor) Now on to 102

  • @deangreenhough3479
    @deangreenhough34797 жыл бұрын

    Still learned a lot, well presented and executed

  • @PeteVanDemark
    @PeteVanDemark7 жыл бұрын

    Excellent video. Thank you. Looking forward to Arduino Basics 103.

  • @thomasrobin
    @thomasrobin7 жыл бұрын

    Love your videos! Please make an advance arduino video series

  • @ElProfeGarcia
    @ElProfeGarcia7 жыл бұрын

    Bien explicado el video, saludos

  • @jamesmoon5632
    @jamesmoon5632 Жыл бұрын

    Great lesson!!

  • @MikesDIYTeslaPowerwall
    @MikesDIYTeslaPowerwall7 жыл бұрын

    Thanks for yet another great video, This helps alot.

  • @FabiiFK94
    @FabiiFK947 жыл бұрын

    great Video :-) I had C Basics last year but you can bring all easy to a nutshell! How to set up a Interrupt at a Arduino is very intresting

  • @Jajaho2
    @Jajaho27 жыл бұрын

    Knows all the stuff. Still watches the video, because Scott is awesome.

  • @kencover2040
    @kencover20407 жыл бұрын

    NEED MORE VIDEOSSSS. But really, love your videos =D Very helpful for learning about the arduino.

  • @fibranijevidra
    @fibranijevidra4 жыл бұрын

    Well presented. Keep on with tutorials.

  • @anaglog77
    @anaglog777 жыл бұрын

    really good! Love your channel! :)

  • @eddiejones8709
    @eddiejones87092 жыл бұрын

    Great videos' as always. I built your FM radio project for my grandson and he really likes it. I have been trying to add an EEPROM read and update function to this project to remember the last frequency selected (with a 5 min timed cycle). So that when the radio is switched on again it would use this frequency instead of the one pre-programed in the sketch. Thanks

  • @youraveragenerd9101
    @youraveragenerd91017 жыл бұрын

    Great video for beginners :D

  • @vishalchavda3663
    @vishalchavda36637 жыл бұрын

    Great Voice u have... and knowledge also...

  • @atscub
    @atscub6 жыл бұрын

    Great video !!

  • @Khatrie169
    @Khatrie1694 жыл бұрын

    really enjoyed your video's was hoping there was an arduino basics 103. wish you would of continued this!

  • @thiagocamargoalima
    @thiagocamargoalima7 жыл бұрын

    I did not know about the attachInterrupt function. thanks!!!

  • @owlsight4499
    @owlsight44997 жыл бұрын

    0:57 - it supposed to be "less than or equal TO" and "greater than or equal TO" Nonetheless; very good job and thanks for another episode!

  • @YoBro230
    @YoBro2307 жыл бұрын

    Great Scott video Mein Herz geht auf :D

  • @ForlornSnake
    @ForlornSnake7 жыл бұрын

    Awesome vid!

  • @MrBiky
    @MrBiky7 жыл бұрын

    Well, I finally understand fully 1 of your videos (because I do programing a lot)

  • @ddsdispbos1155
    @ddsdispbos11557 жыл бұрын

    Thank you very much. Great video

  • @k_8609
    @k_86097 жыл бұрын

    first video that made sense to me , Its very similar to C++

  • @JVG_2009
    @JVG_2009 Жыл бұрын

    Thank you for amazing information about Arduino programming 👍

  • @JoshuaHeckathorn
    @JoshuaHeckathorn7 жыл бұрын

    #icantprogramforshit SO - I will be referring to this pretty much every time I build with an Arduino, just like I've referred to many of your other videos, among other resources. The pace is quick, but you're quite concise and I almost always learn something so rewatching to pause and soak it all in is not the problem for me. Thanks!

  • @ShaileshDagar
    @ShaileshDagar5 жыл бұрын

    Great Video, would love to see Arduino Basics 103.

  • @yashaswikulshreshtha1588
    @yashaswikulshreshtha15882 жыл бұрын

    I have been using Arduino's for quite a long time, and I have to say I absolutely love them, you don't have learn C in the first place you can get along with Arduino just fine you might have some problem with concepts but with it will never be complicated, with Arduino you'll start off with making programmed electronics project and I think this way is actually really good of developing knowledge of electronics and programming at the same time, it covers both domains. Also I think as you will learn more you'll see actual programming languages like python, C++, Arduino C and java generally consist of 1) Variables and advance Variables 2)Control structures 3)Interrupts they can contain a lot of things of could vary but they all consist of these at least, what makes you a good programmer isn't learning the concepts but to be able to develop concepts, as you'll advance through the journey from intermediate to advance you'll see now you have to learn programming techniques and algorithms, you'll start off with making few simple to intermediate level techniques after some time you'll realize what algorithm and techniques are all about and at that point you might be able to step into the further most step and that is probably expertise in this level you'll apply your knowledge in real world technology and developing algorithms, techniques for robots or anything to function. At that point you'll have such good knowledge of coding and concepts that it will be just like a language you speak or like basic maths, your focus will be more on actual functionality of the things, coding will be just like translating the entire expression to machine that's all, It can get tedious, programming hundreds and thousands of code will get you exhausted, but hey that will just fade away just in half and hour or couple hours and you'll love it after you'll return. At that point you might be interest in exploring a little bit more in this field and understanding not just algorithms and stuff but a lot more than that, with being good in robotics you can get better by combining your knowledge with learning new things like networking, webpage communication, TELNET shell commands, and trust me robotics and electronics is branch that covers literally all domains of technology like A.I, Machine learning, physics, Math's, Computer Science, programming, mechanics, electronics, electricals(sort of), Network and communication, chemistry, philosophy, Bionics, data science, data analysis, database management, application development, Nano technology. Although in the term robotics you can literally cover these all things as it incorporates use of everything but keep in mind that robotics is still isn't advanced as living physical biology and despite the fact they have their pros and cons, you may see all those domains as more like aspect or additionality to robotics however robotics in real world at least covers domains like, physics, Maths, CS, programming, mechanics and electronics as basic requirements. Those aspects range so much that they have their own separate fields and are separate subjects. I believe pursuing career in robotics will be more beneficial cuz you'll be exposed to many aspects and fields at once and how they interact with each other, having good foundation through those you'll be able to switch between careers in science and technology pretty easily such as if you're robotic programmer than you can be software engineer or application developer etc I don't say what I say is hundred percent accurate but I am just giving general idea. I hope if any beginner or someone who's interested in tech will find this helpful.

  • @ravitdayal5774
    @ravitdayal57747 жыл бұрын

    Thank you sir I really liked the first video of this series and I love this one very helpful.do you use other microcontrollers.if yes can you teach about them too?

  • @asadkhan7441
    @asadkhan74417 жыл бұрын

    keep it up scott.

  • @mohammadmuwafi3623
    @mohammadmuwafi36237 жыл бұрын

    The Best Channel

  • @georgelewisray
    @georgelewisray3 жыл бұрын

    MOST Excellent !

  • @FHBStudio
    @FHBStudio7 жыл бұрын

    I'd like at least three more in this series. The one you mentioned, one as an introduction to sensors and working with sensor data and a last one, which discusses when to use an arduino or when to use alternatives. For example, I wanted a device to water my plants every 24 hours so I made a prototype with Arduino only to consider that the Arduino is too OP for such a simple function. Another project was to have a dimming LED strip light up over a settable time span at settable times. Again, Arduino prototype, end result: alarm clock + LED controller, without an Arduino. In the end, that last approach was soo much better than the Arduino, since it already included configuration components that I'd have to build from scratch on the Arduino.

  • @hassaananwar6212
    @hassaananwar62127 жыл бұрын

    Great video , dude .~!

  • @kroome8
    @kroome87 жыл бұрын

    great!!! nice tutorial... cheers!!

  • @UsePINpadtoCompleteTransaction
    @UsePINpadtoCompleteTransaction7 жыл бұрын

    YES *in a bigger font than allowed* Thank you!!

  • @omkarbhatt2729
    @omkarbhatt27297 жыл бұрын

    Great Scott. I'm a big fan of your work. just wanted to know what oscilloscope do you use? and can you do a video on oscilloscopes and their different types.

  • @chbonnici
    @chbonnici6 жыл бұрын

    Thank for the video . It would have been nice if you showed the full program. Where did you declare "m"

  • @jayzo
    @jayzo7 жыл бұрын

    This is a really useful video. Does the Arduino handle overflows by itself or will you have to add code to deal with errors like it.

  • @jansinski6213
    @jansinski62137 жыл бұрын

    can you show how to conect simple lcd to arduino nano

  • @jneirag98
    @jneirag987 жыл бұрын

    Awesome video! It would be amazing if you can explain the different ways you can damage an Arduino in order to prevent it ;)

  • @greatscottlab

    @greatscottlab

    7 жыл бұрын

    Sounds like an interesting video ;-)

  • @davincidamaster5311

    @davincidamaster5311

    4 жыл бұрын

    That's the sort of stuff ElectroBoom would do!

  • @RoamingAdhocrat
    @RoamingAdhocrat4 жыл бұрын

    If you're keeping pin numbers in an array, 1: use an enum to name the index values 2: use `for( auto p : pins)` to get the pin values

  • @pepemoore1
    @pepemoore17 жыл бұрын

    very cool like every video.

  • @YG3BMP-JZ13FLI
    @YG3BMP-JZ13FLI4 жыл бұрын

    Gracias por el tutorial, el botón de suscripción ya ha sido presionado

  • @mnx4me
    @mnx4me7 жыл бұрын

    Excellent....thanks

  • @tonythediyer8537
    @tonythediyer85377 жыл бұрын

    @GreatScott! I wish I had your handwriting skills. Nice vid.

  • @rahulvc7791
    @rahulvc77917 жыл бұрын

    Hi was waiting cool video thanks

  • @greatscottlab

    @greatscottlab

    7 жыл бұрын

    You' re welcome :-)

  • @josea.hernandezs.348
    @josea.hernandezs.3487 жыл бұрын

    hi! as you i am engineer, but in telecommunication i enjoy your videos. you has nice ideas and curious experiment, i hope so can study a master in Germany some day :)

  • @BlizzetaNet
    @BlizzetaNet7 жыл бұрын

    I never even knew about attachInterrupt(...); Thank you Thank you!

  • @madhumatisoni4596
    @madhumatisoni45967 жыл бұрын

    I like that video very much...!!

Келесі