Arduino Uno R4 WiFi LESSON 16: Understanding If Statements and Conditionals

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ก.พ. 2025
  • Pick your Sunfounder kit up so you get the same results I do:
    amzn.to/3SciApZ
    You can pick up the neat jumper wires I showed in the video here:
    amzn.to/3U2vyIe
    You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:
    / paulmcwhorter
    In this video I show you how use If Statements in Arduino. We will look at the various conditional that can be used, and we will explore compound conditionals using 'and' and 'or' logical commands. Enjoy!
    [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. ]
    #arduinor4wifi
    #ifstatements
    #tutorial

ความคิดเห็น • 54

  • @youssefshepl6892
    @youssefshepl6892 9 หลายเดือนก่อน +4

    Now, I am following the Arduino R3 tutorials, but I came here to tell you that you are the best teacher I have ever seen

  • @mohammedsadiq2045
    @mohammedsadiq2045 9 หลายเดือนก่อน +1

    3 words:
    Amazing
    Amazing
    Amazing
    I Really learned from you Mr. Paul, and I would love if you made serial videos about ESP32 using MicroPython or arduino, or both
    Thank you

  • @larryplatzek9017
    @larryplatzek9017 9 หลายเดือนก่อน

    Most programs need to use if statements and conditionals, so this is another important lesson!

  • @TheUnofficialMaker
    @TheUnofficialMaker 9 หลายเดือนก่อน

    2 tips: 1. clear monitor window before each run. 2. include a print to show what number you entered, hard to see on the line where you enter the value and goes by quick. Nice work.

  • @louistoweill4232
    @louistoweill4232 9 หลายเดือนก่อน

    Good morning from Washington state. Thanks for the lessons!

  • @jamesjones-gk2gp
    @jamesjones-gk2gp 2 หลายเดือนก่อน

    You might want to indent - Conditional statements, while, for statements to give your code some formating. You will find it easier to read

  • @woowocgwhwrehvcb
    @woowocgwhwrehvcb 6 หลายเดือนก่อน

    Great Lesson. I aced the homework.

  • @310765
    @310765 9 หลายเดือนก่อน

    Brilliant Paul, thank you so much 😊 👍🏼

  • @EI.01
    @EI.01 9 หลายเดือนก่อน

    Sir when will you have to make videos on how to use the esp32

  • @anitamlv
    @anitamlv 9 หลายเดือนก่อน

    Hi Mr McWhorter, Do you can help me with a Bluetooth Module HC05, to set Role Master? I cannot change the role, please help me

  • @electronichome1153
    @electronichome1153 9 หลายเดือนก่อน

    I've used if else during this tutorial, instead several if conditions

  • @scottwait3585
    @scottwait3585 9 หลายเดือนก่อน

    Thank you Paul

  • @chrisallen2894
    @chrisallen2894 5 หลายเดือนก่อน

    👍

  • @ex1stenz
    @ex1stenz 9 หลายเดือนก่อน

    i lost the meaning of "Serial.parse", what is "Parse" standing for?

    • @robertschuldenfrei2402
      @robertschuldenfrei2402 9 หลายเดือนก่อน +1

      Parse means to split apart. You could split out an integer from a string by writing a program to look at the string character by character. You would be looking at each character to see if it was a number. You would have to be mindful of the minus sign. Years ago, 1968 to be exact, I did just that with the original Dartmouth BASIC.

    • @ex1stenz
      @ex1stenz 9 หลายเดือนก่อน

      @@robertschuldenfrei2402 oh ok got it! Many thanks! :)

  • @patrickfox-roberts7528
    @patrickfox-roberts7528 9 หลายเดือนก่อน

    👍👍

  • @electronichome1153
    @electronichome1153 9 หลายเดือนก่อน

    For typing OR in Windows - type twice Alt+124

  • @qzorn4440
    @qzorn4440 6 หลายเดือนก่อน

    wikipedia... One 0 (zero) is a number representing an empty quantity. Adding 0 to any number leaves that number unchanged. 🤞 Twilight zone stuff.

  • @VeryUsMumblings
    @VeryUsMumblings 9 หลายเดือนก่อน

    More Comments for TH-cam juice!

  • @richardsstark9825
    @richardsstark9825 9 หลายเดือนก่อน

    My Homework th-cam.com/video/52rodJoi7eA/w-d-xo.htmlsi=f_djVs8j0s2FAlNb
    I tried to set up the code so any input other than red, yellow and green would turn off the LEds and give a message like "there is no such LED", like:
    if (colInput !="red" || colInput !="green" || colInput !="yellow"){
    digitalWrite(rPin,LOW);
    digitalWrite(gPin,LOW);
    digitalWrite(yPin,LOW);
    Serial.print("there is no such LED"); }
    But this doesn't work. Any suggestions?

    • @paulmcwhorter
      @paulmcwhorter  9 หลายเดือนก่อน

      LEGEND!

    • @robertschuldenfrei2402
      @robertschuldenfrei2402 9 หลายเดือนก่อน

      Hi Richard, && not ||

    • @richardsstark9825
      @richardsstark9825 9 หลายเดือนก่อน

      Thank You Robert! Yes, this worked but I still don't understand the logic behind it.@@robertschuldenfrei2402

    • @robertschuldenfrei2402
      @robertschuldenfrei2402 9 หลายเดือนก่อน

      @@richardsstark9825 Here is the logic behind it. In the || (or) construction if the color you entered is "red" it fails the first test since the color IS red, but it passes the second test because red is not "green." Even if the red LED was turn on in an earlier test like if(colInput="red") it will be turned off immediately when it hits your "or" constructed statement.
      If you want to learn Arduino programming at a much deeper level than Paul can do in this course I recommend a very elementary book: Sams Teach Yourself Arduino Programming in 24 Hours by Richard Blum. Even if you have never written a program before you could learn how it is done with this book. You will come to understand why some function look like loop() and others look like myValue.toInt(). [answer: the first is a function and the second is string object method]

  • @jeff_wild
    @jeff_wild 9 หลายเดือนก่อน +1

    My lesson 16 homework assignment: th-cam.com/video/nYkF0IMNQwE/w-d-xo.html

  • @drdentin3215
    @drdentin3215 9 หลายเดือนก่อน

    My ArduinoR4 homework 16 th-cam.com/video/CWhfxXDP6s8/w-d-xo.html. Thanks Paul. I used a blinkLED function. Paul has recently gone over functions classes and methods in the PicoW series approximately lesson 64. I thought it would be a challenge to see if I could do it in the Arduino IDE.

  • @alistaircook1997
    @alistaircook1997 9 หลายเดือนก่อน +1

    Enjoyed your If Satement lesson, here is my homework for lesson 16 :- th-cam.com/video/S9u7Y60q7Bs/w-d-xo.html

  • @LorisHW
    @LorisHW 7 หลายเดือนก่อน

    HW link Try #56: th-cam.com/video/m9ZJnMYjYao/w-d-xo.html

    • @paulmcwhorter
      @paulmcwhorter  7 หลายเดือนก่อน +1

      Its been a while, glad to see your homeworks once again.

    • @LorisHW
      @LorisHW 7 หลายเดือนก่อน

      @@paulmcwhorter I seem to have found a link that did not get rejected this time. It continues to be a problem ...

  • @robertschuldenfrei2402
    @robertschuldenfrei2402 9 หลายเดือนก่อน

    Finally got the video to stick. th-cam.com/video/hKybxCN254Y/w-d-xo.html

  • @Tron_Starfighter
    @Tron_Starfighter 8 หลายเดือนก่อน

    LEGEND - th-cam.com/video/nh58xa94XrY/w-d-xo.html

  • @stinky2202
    @stinky2202 9 หลายเดือนก่อน

    Wrong James Cameron LoL

  • @Adrian427
    @Adrian427 8 หลายเดือนก่อน

    Thanks, Paul, for another great tutorial. Homework completed: th-cam.com/video/cxRd81L6n_U/w-d-xo.html

  • @perfectly_unstable
    @perfectly_unstable 5 หลายเดือนก่อน

    Excellent lesson as usual. Homework complete th-cam.com/video/rDCG9vGABpY/w-d-xo.html Many Thanks!!

  • @FreidonNasrat
    @FreidonNasrat 9 หลายเดือนก่อน +1

    studio.th-cam.com/users/videoJlQ49ifHXz8/edit Homework lesson16

  • @drthik1
    @drthik1 6 หลายเดือนก่อน

    I got it! Didn't open the laptop till after the lesson was over and started fresh.
    th-cam.com/video/4dHz5QMXcwk/w-d-xo.htmlsi=4RkbI_kSk4pdqE_W

  • @alfredvink
    @alfredvink หลายเดือนก่อน

    Homework done.
    th-cam.com/video/CJZR0kM8kcs/w-d-xo.html