Go Down

Topic: easy for loop question (Read 581 times) previous topic - next topic

0miker0

My C programming skills are pretty bad but I'll ask this question anyway. The code below has been simplified for this question. How can each spin of the for loop check each function below?

for (i=0; i<8; i++)
{
  clock();             //clocks 8 times 
  set_up_pini();   //want to check each below  but get an error here
}

void set_up_pin1()
{
digitalWrite(Select_A, LOW);
digitalWrite(Select_B, LOW);
digitalWrite(Select_C, LOW);
}

void set_up_pin2()
{
digitalWrite(Select_A, HIGH);
digitalWrite(Select_B, LOW);
digitalWrite(Select_C, LOW);
}
 
...

PaulS

Quote
How can each spin of the for loop check each function below?

Once more, in English, please. Loops don't spin. They iterate. What does "check each function" mean? The compiler checked the function before the linker built the executable code that was uploaded.

AWOL

Quote
//want to check each below  but get an error here
Because you haven't declared a function called "set_up_pini"
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

0miker0


Go Up