CS:GO bombtimer

Hi everybody,

as most of you who play Counter Strike play know, the bomb makes beeping effects, but with shorter delay between the beeps when the timer comes to the end. So I thought it was a piece of cake to do this; yet i failed so I ask you for help.

void loop() 
{
 del = 1000;
  for (i=0; i=45; i++)
  {
    x = map(i,0,45,0,1000);
    tone(piezo, 50);
    delay(500);
    noTone(piezo);
    i++;
    del = del - x;
    delay(del);
  }
}

My code so far, the flaw is, that it will just run veeery fast to the end and therefore the beep is constant as soon as i turn my Arduino on. If i add a constant delay however, it will never go to the almost-constant-beep-state that the actual bomb does.

Thanks to all helpers in advantage :)

Examine your for loop statement. I don't think the condition is exactly what you intended.