I found this code in the second project of the book "30 arduino projects for the evil genius".
void loop()
{
flash(200); flash(200); flash(200);
delay(300);
flash(500); flash(500); flash(500);
flash(200); flash(200); flash(200);
}
void flash(int duration)
{digitalWrite(ledPin, HIGH);
delay(duration);
digitalWrite(ledPin, LOW);
delay(duration);
}
I understand what the function does, but I'm unable to understand "int duration" is doing in void flash();
Is the variable being declared ? Shouldn't it be done before void setup()
Thanks in advance.
