Transfer parameter-value from loop to function

int value = 0; // set value to 0 at first
  dofunction (value);

You still don't get it

value is declared as a global so you don't need to pass it to the function. In fact, doing so can cause more confusion because you still have 2 different variables named value, one with global scope and one whose scope is in the function