Arduino Workshop - Chapter Three - FOR Loops

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 พ.ย. 2024

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

  • @geoffwade8144
    @geoffwade8144 3 ปีที่แล้ว +2

    I’ve just discovered your channel and really like it, good job.

  • @RajaSingh-hs2tb
    @RajaSingh-hs2tb 4 ปีที่แล้ว +1

    You explained very well

  • @puvaneswaransivakumar9469
    @puvaneswaransivakumar9469 4 ปีที่แล้ว +3

    Can I know how to loop forever the melody example in arduino??

  • @infatum9
    @infatum9 6 ปีที่แล้ว +7

    I think they chose i for for loops because it stands for iterations.

    • @Sedokun
      @Sedokun 3 ปีที่แล้ว

      It stands for 𝑖, 𝑗 indexing Index Notation in math. [Aᵢ ⱼ] where 𝑖 - index, 𝑗 - is just the next letter for labeling the next dimension (then goes 𝑘, 𝑙, 𝑚, 𝑛 ...)

  • @johnnagy1575
    @johnnagy1575 4 ปีที่แล้ว +2

    I don't want to ramp up and down. Just want to blink the led 5 times. Stop. And wait for a Button push again. Any videos on that??

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

    Nice. fyi, 'i' is used for convention in loops to indicate "iterations".

  • @attalaw36
    @attalaw36 4 ปีที่แล้ว +2

    nice lesson thank you ...

  • @omtandon2741
    @omtandon2741 4 ปีที่แล้ว +1

    I searched this on youtube for the same thing!!!

  • @tareksma1
    @tareksma1 2 ปีที่แล้ว

    Thanks for sharing. I finally understood the for loop. Now I kinda feel dump for not being able to understand it sooner 🙃 😕

  • @waluxstudio7921
    @waluxstudio7921 4 ปีที่แล้ว +1

    Thanks for explanation. I like it

  • @nuwanchathuranga8479
    @nuwanchathuranga8479 4 ปีที่แล้ว +1

    thanks a lot.....

  • @ryanbennett8434
    @ryanbennett8434 2 ปีที่แล้ว

    If this doesn't work for you then make sure you are using the digital pins (NOT analog).

  • @danieljohnsopardenilla997
    @danieljohnsopardenilla997 4 ปีที่แล้ว +3

    So a 'for' is like a sub loop?

    • @Sedokun
      @Sedokun 3 ปีที่แล้ว

      It is. And this is why this code is "blocking" it halts the Loop until For is finished.

  • @whitefields5595
    @whitefields5595 6 ปีที่แล้ว +1

    As you only want to count 0-255 would you save memory if you defined i as a BYTE datatype rather than an INT?

  • @geneh9210
    @geneh9210 2 ปีที่แล้ว

    What does the statement "for(;;);" do? I've seen it in a couple of example sketches. Thanks.

  • @salc9593
    @salc9593 6 ปีที่แล้ว +2

    Thank you for posting this video, it has been a great help in my learning of Arduino coding. I would like to ask if I wanted to have this LED ramp 5 times would I add the first part of the code you show at min: 0:20 around the ramp code by using curly bracket? Thank you again for posting these videos.

  • @Perdonadoooooo
    @Perdonadoooooo 3 ปีที่แล้ว +3

    In case someone else's LED only ramps down and not up, write "for(int i=0; i < 256; i++)" instead of the first _for_ shown in the video. Mine behaved like so and with that correction it now works properly. I'm guessing "int i" doesn´t declare AND set the variable to 0, so that's why it only ramped down. Someone correct me if im wrong

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

      Yeah I'm pretty sure you're right. He had a typo for sure.

  • @viktortousseyn7698
    @viktortousseyn7698 ปีที่แล้ว

    How do you do 7 led lampjes burning

  • @scopellafranqui
    @scopellafranqui 5 ปีที่แล้ว +8

    I've had to change "int i" for "int i = 0" in my first for loop otherwise each loop starts with i having a value of 255. i.e. if I don't add "int i = 0" the LED starts each loop at max brightness then fades instead of ramping up then fading.

    • @vinothparker7425
      @vinothparker7425 4 ปีที่แล้ว

      i'm also facing the same issue right now. i want to know the reason why this is happening like sir. can you help me?

    • @vinothparker7425
      @vinothparker7425 4 ปีที่แล้ว

      void setup()
      {
      Serial.begin(9600);
      }
      void loop()
      {
      int i;
      for(i; i

    • @mr.m_photographs
      @mr.m_photographs 4 ปีที่แล้ว +1

      Same thing happened to me. This fixed it.

    • @robertaragon8270
      @robertaragon8270 4 ปีที่แล้ว

      same

  • @Chriss.lindstrom
    @Chriss.lindstrom 6 ปีที่แล้ว +2

    How do I make the code jump out of the 'for' loop? As soon as it counts to 5 for me, it starts over at 0 and jumps straight back into the loop. I want the value of x to stay at 5 until I press a button.

    • @d3bbi339
      @d3bbi339 4 ปีที่แล้ว

      i believe you would add
      break;
      inside of the "for" loop. but im just referencing his previous video about "while" loops so i might not be correct. lol

  • @-stoner
    @-stoner ปีที่แล้ว

    I'm trying to make a game where LED's blink back and forth and when you press a button it stops on the LED it's on and gives a certain point value for each LED but the for loop keeps iterating and blinking the LEDs

  • @vinothparker7425
    @vinothparker7425 4 ปีที่แล้ว +2

    void setup()
    {
    Serial.begin(9600);
    }
    void loop()
    {
    int i;
    for(i; i

    • @Core-Electronics
      @Core-Electronics  4 ปีที่แล้ว

      tricky ! If you can, please post this to our forum coreelec.io/forum - our team can provide better support for coding issues there.

    • @pranilshoots9523
      @pranilshoots9523 2 ปีที่แล้ว +1

      Its becaude the ASCII equivalent of 0is 52. You need to convert it to integer to see correctly in serial monitor

  • @jean_pattat1204
    @jean_pattat1204 6 ปีที่แล้ว +1

    i had troble with this so i watched other videos and i found the error you must be plugged in with a digital pwd most bords have these and are marked with a ~

  • @firealarmswithcolton5169
    @firealarmswithcolton5169 2 ปีที่แล้ว

    my brother told me i need a for loop for a buzzer tone sequence on an if but this video made no sense to me.

  • @PAWNB3YOND
    @PAWNB3YOND 5 ปีที่แล้ว +1

    I love you.