Please, somebody tell me why my functions don't respond when I call them.
In the following code everything works fine:
int nose = 7;
void setup() {
pinMode(nose, OUTPUT);
}
void loop() {
digitalWrite(nose, HIGH);
//turnNoseOn;
delay(500);
digitalWrite(nose, LOW);
//turnNoseOff;
delay(500);
}
void turnNoseOn() {
digitalWrite(nose, HIGH); // turn the LED on
}
void turnNoseOff() {
digitalWrite(nose, LOW); // turn the LED off
}
But if I comment out the digitalWrite statements and use the function calls instead (see below), nothing happens.
I am an experienced programmer but not much with C.
Please tell me what obvious error I am making here.
int nose = 7;
void setup() {
pinMode(nose, OUTPUT);
}
void loop() {
//digitalWrite(nose, HIGH);
turnNoseOn;
delay(500);
//digitalWrite(nose, LOW);
turnNoseOff;
delay(500);
}
void turnNoseOn() {
digitalWrite(nose, HIGH); // turn the LED on
}
void turnNoseOff() {
digitalWrite(nose, LOW); // turn the LED off
}