Pages: [1]   Go Down
Author Topic: easy for loop question  (Read 481 times)
0 Members and 1 Guest are viewing this topic.
Nova Scotia
Offline Offline
Full Member
***
Karma: 4
Posts: 187
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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);
}
 
...
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 551
Posts: 46266
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 240
Posts: 24465
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
//want to check each below  but get an error here
Because you haven't declared a function called "set_up_pini"
Logged

"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.

Nova Scotia
Offline Offline
Full Member
***
Karma: 4
Posts: 187
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ahh.

Thanks AWOL!
Logged

Pages: [1]   Go Up
Jump to: