Could someone please explain to me the theory behind this code? I am mostly confused by this recurring line:
for (int i=0; i < 3; i++)
Class_1_professional.ino (753 Bytes)
Could someone please explain to me the theory behind this code? I am mostly confused by this recurring line:
for (int i=0; i < 3; i++)
Class_1_professional.ino (753 Bytes)
I do not understand the following recurring line of the attached code:
for (int i=0; i < 3; i++)
Could someone please explain the theory of what each element in this line of code means. For example, one thing that confuses me is why my led blinks 3 times when the code says i less than 3. Shouldn't that mean it never get to the third blink? Any assistance would be greatly appreciated. Thanks
Class_1_professional.ino (753 Bytes)
It is very simple, For is a cycle, it means that it will repeat all the code it has between the {}, it will repeat it as many times as you indicate. To tell you how many times the cycle will repeat is used (int i = 0; i <3; i ++), this means that you are creating a variable called "i" that is 0, the code will be executed as long as its value is less than 3, remember that 0 counts, would be 0, 1 and 2
Look up "C/C++ for loop"
TOPIC MERGED.
Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum.