For-Loop ignoring delays? Beginner's Problems.

Hi. I'm trying to repeat a beep function that turns on a tone and a digital output for an LED and then turns both off again after a delay.

void beep() {
  tone(8, 5000);
  digitalWrite(13, HIGH);
  delay(100);
  digitalWrite(13, LOW);
  noTone(8);
}

Pretty simple. But when I put this into a for-loop, I only get one beep.

for (int i=0; i<=10; i++); {
  beep();
  delay(200);
}

If I modify the code to give me serial outputs in every iteration, it only gives me one output and my variable "i" jumps to 11 immediately.

for (int i=0; i<=10; i++); {
  beep();
  Serial.print("i = ");
  Serial.println(i);
  delay(200);
}

Serial Output:

i = 11

I feel like I'm making some obvious rookie mistake here, so I hope someone can help me out.
Thank you!

Hello and welcome,

There is one mistake in your code:

for (int i=0; i<=10; i++); {

That semicolon shouldn't be here, basically your loop does nothing because of that :wink:

guix:
Hello and welcome,

There is one mistake in your code:

for (int i=0; i<=10; i++); {

That semicolon shouldn't be here, basically your loop does nothing because of that :wink:

Oh wow :smiley:
That was a dumb mistake.
Thank you for pointing it out to me!