Using Arrays with For Loops

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

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

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

    At 16:30 why is the first line of output messed up? It happened on the other examples too.

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

      Great question and nice observation Mark! I am sure some out there could explain this (and I would love to know as well), but I _think_ it has to do with the Serial Monitor reseting the Arduino when it is opened.

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

    Every video is better than the previous! You do such a good job of helping me discover the value in the details.

  • @warrenstaben6166
    @warrenstaben6166 2 ปีที่แล้ว +7

    Thank you so much. Your videos are so well done and easy to understand!

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

    Outstanding explanation!

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

    You break down information so well! I really appreciate these videos.

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

      Thanks so much for the note! Much appreciated!
      If there is any info in particular you are looking to learn about, please feel free to let us know and we'll try and make a video on it.

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

      @@programmingelectronicsPerhaps interrupts/timer interrupts?

  • @KW-ei3pi
    @KW-ei3pi 9 หลายเดือนก่อน

    Thanks! Very good tutorial. You went through the last part pretty quickly, and I couldn't figure out why "now" didn't print on the second and subsequent loops. It wasn't entirely clear that the INDEX values were in memory and could be overwritten by code to a new value. I get it now. Thanks. Regards.

  • @aaronfidelisrecine
    @aaronfidelisrecine 5 หลายเดือนก่อน +1

    MANNNNNN I've been losing my damn MIND trying to understand for loops and arrays and WOW you make it so easy! THANK YOU!!!!

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

    Been watching your vids since 2019. I Truly like the way you provide information.thank you

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

    This is golden (as is the whole series)
    Subbed!

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

    Вы большой молодец , что делаете такие обучающие видео , спасибо большое !

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

    Thanks for the video, hope you can share the application of using this on the sensor as you mention in the beginning. Tq sir

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

    This is really good, thanks!!!

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

      Thanks a ton for watching! I hope it was helpful!

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

      @@programmingelectronics Im probably one of the oldest fans on the channel. I followed your channel about 8 years now and i remember the first videos you posted when you were drawing and explaining the micro-controller pins on paper. Was a fan back then, still a fan.

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

      @@thomashvnmusic Thanks for sticking around!!!

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

      @@michaelcheich2481 Absolutely!

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

    If you don't need to know index i, you can use range based for loop: for (float val : sensorReadings) { } ; plus with another feature of c++11 "auto": for (auto val : sensorReadings) { Serial.println(val); } - less you have to write mans less bugs you can make

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

    That was a great tutorial of a for loop! 😂 Maybe part 2 can explain how to append an array or what types of variables can go into an array.

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

      Thanks for the note and recommendation Warren! In retrospect I can see this is more a "for loop video" than an "array video"
      We changed up the title and thumbnail to hopefully reflect that better.

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

    Really helpful.🙌

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

    How to iterate array with millis() function or iterate through multiple arrays simultaneously

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

    Seems to me that i = 0 gets incremented before the next line, so the array’s index will never be 0 but rather 1,2,3.

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

      I may have not explained it appropriately in the video, but when _entering_ a "for loop", the variable gets initialized and the condition is checked. The increment/decrement happens at the end of the for loop before the next check of the condition.
      1st-> initialize var, check condition
      n...-> increment/decrement, check condition
      Hope this helps clarify!

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

      @@programmingelectronics You're the best! Thanks.

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

      The '++' operator increments the variable. If it's placed after (i++), the variable will be incremented after the code in the loop is executed, if the operator is placed before the variable (++i), the variable is incremented before entering the loop. Same rules applies to the '- -' operator.

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

    Thanks for the video. However, it is more lf a FOR loop video then Array Video.

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

      You are right! Title adjusted, and I think we'll change out to a more representative thumbnail.
      Thanks @Abrar!

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

    An excellent explanation of how the for loop actually works when iterating arrays. Thank you.

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

    hi thanks you for the informative about arduino can you make a video to combine 3 sketch that have different doing. like relay lighting , automatic water, and a dht11 sensor

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

    Nice info, keep it up,thanks for sharing :)

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

    Its so entertaining listen to you

  • @j.w.8663
    @j.w.8663 ปีที่แล้ว

    👍🏻

  • @بوزيدأمينأستاذالعلومالفيزياء
    @بوزيدأمينأستاذالعلومالفيزياء 6 หลายเดือนก่อน

    god bless you

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

    hip, hip, array

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

    char bestTeachers [][3] = {{“Programming Electronics Academy”}, {“Brocode”}, {“Paul McWhorter”}};