Im going to assume its because the first parameter in the for loop is asking for its own integer rather than one thats already been made elsewhere. int i = delay_sec would probably work best in that situation. not 100% sure on that one though... more like 85% sure heh

Try the while loop, it might save a variable (that' important on an MCU).If you don't want anything in the initialisation part of your for statement then write nothing, you wrote the name of the variable as if it were a declaration of some sort.

The error, I think, in the code is that you have not assigned a value to "delay_sec" in the for loop.Since it has already been assigned previously and you wish to use that value, just skip the initialization expression in your for loop.

void resetChip(int delay_sec) {So the compiler is like, why should I do a for loop for delay_sec > 0 when delay_sec=0? Your code is legit, it's just the compiler is a bit confused . . .

No-no. There's no "delay_sec=0" code in pomprocker's code; Your brain sees it because you expect it in the begining of the for statement, but there's no such thing. The loop initialisation in the for statement is not valid because it just says the name of the variable, no equal sign, no-nothing The compiler is spot-on.

No-no. There's no "delay_sec=0" code in pomprocker's code; Your brain sees it because you expect it in the begining of the for statement, but there's no such thing. The loop initialisation in the for statement is not valid because it just says the name of the variable, no equal sign, no-nothing The compiler is spot-on.

The gcc compiler initializes non-initialized variables as 0. But not sure if it's all variables or just non-global or what . . .

No-no. There's no "delay_sec=0" code in pomprocker's code; Your brain sees it because you expect it in the begining of the for statement, but there's no such thing. The loop initialisation in the for statement is not valid because it just says the name of the variable, no equal sign, no-nothing The compiler is spot-on.

The gcc compiler initializes non-initialized variables as 0. But not sure if it's all variables or just non-global or what . . .

It initializes non-initialized global variables to 0. Local variables are uninitialized. The value might be 0 is the memory was previously set to 0. But there is no guaranty.Pratheek and Cosmicprund are right, the statement with no effect is to warn you that the initialization of his for loop ("delay_sec") has no effect (it is not initialized).