# for 2

Hello
I have on order

``````for (f =1, f <8, f++) {
//blablabla}
``````

my question is stupid my f = 1 means that it puts f at 1 or that if f is equal to 1 it executes what is after

I thought you wanted eight iterations?
The reference page for the for loop is a.useful starting point for learning.
Why have you started another topic?

I ask the question for something else because its not working for me and from what I understand f = 1 means that it puts f equal to 1 puts like its not working I’m not sure

(I started arduino for less than 1 week)

ludocraft:
my question is stupid my f = 1 means that it puts f at 1 or that if f is equal to 1 it executes what is after

It sets f to 1

Many things in programming start at 0. For example the elements in a 4 element array are numbered 0 to 3

...R

2nd question as I do not know if it is necessary to create another subject
I have

``````for (f =7; f >1; f--){
Write_Max7219(f, 126);
delay(150);
}
``````

It does not work normally it should do something like this

``````Write_Max7219(7, B01000010)
Write_Max7219(6, B01000010)
Write_Max7219(5, B01000010)
Write_Max7219(4, B01000010)
Write_Max7219(3, B01000010)
Write_Max7219(2, B01000010)
``````

its not working its pass to what is after
eceque I made a mistake somewhere where it is normal ??
for is in an else if
the if part works well

I said nothing I was wrong between the first condition and the 2 nd Write_Max (f) had the same value on both is for its that I had the impression that its does nothing

Please post the complete program and also post a sample of the actual output.

...R

126 is not B01000010.

ludocraft:

``````for (f =1, f <8, f++) {
``````

//blablabla}

``````

my question is stupid my f = 1 means that it puts f at 1 or that if f is equal to 1 it executes what is after
``````

Since you used ‘,’ instead of the required ‘;’, and you commented out the closing ‘}’, your statement won’t compile. If you had done it correctly:

``````   for (f = 1; f < 8; f++)
{
//blablabla
}
``````

the result would be roughly equivalent to:

``````  {
f = 1;
while (f < 8)
{
//blablabla
f++;
}
}
``````