Arduino Lesson 02- Introduction to "For Loop"

2개월 전

Hi guys,

You all are welcome to @dulip blog today to the second lesson of Arduino, I think you would try our last lesson and today I'm trying to tell you about very special code "for loop", because it is very easy to use when you practice it well and no need to code again and again.. You can save your time.. Basically we can say it is very useful for any repetitive action. Now we'll consider about the "for coding " further.

image.png
Src

Syntax

First I will explain about the syntax of the code, below you can see it. There are there things we have to know before use this code....

for (initialization; condition; increment)

Parameters

  • initialization: happens first and exactly one time(once)

  • condition: each time through the loop(continuously), condition is tested; if it’s correct(true), the statement terminates, and the increment is done, then the condition will be tested again. When the condition becomes incorrect (false), the loop will end.

  • increment: done each time through the loop when condition is correct(true).
    src

Screenshot 2021-07-21 100214.png

This is a short lesson but it will be very useful to you because for the most of your future projects. I hope you will try this for loop coding with your previous lesson blinking LEDs,then you can realize the difference.. Try it for at least five LEDs from both coding..

Thank You & Stay Safe.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
STEEMKR.COM IS SPONSORED BY
ADVERTISEMENT
Sort Order:  trending

image.png

Nice to read your post .

Keep posting and stay with our community

Thank you

You have been upvoted by @tarpan A Country Representative, we are voting with the Steemit Community Curator @steemcurator07 account to support the newcomers coming into steemit.


Follow @steemitblog for the latest update. You can also check out this link which provides the name of the existing community according to specialized subject

For general information about what is happening on Steem follow @steemitblog.

·

thank you very much