Car horn double beep

I am trying to create code for a heltec esp32 to beep a car horn with 2 short toots of the horn. I am ok with increasing and decreasing voltate/ relays etc. If the push button is held on then i'd like it to have beeped twice then do nothing until the button is released ie I dont want it to keep beeping. Then when the push button is pressed again it does another double toot. The code below works once but it doesn't do anything after the first double toot. I have tried playing around with the break function but it keeps beeping when holding the button down. I only want it to beep twice.
Note my buttin is on pin 15 connected to +5v pin and the inbuilt LED is on 25 on this board.
Thanks in advance for any help.

const int buttonPin = 15;
const int ledPin = 25;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);}
void loop() {
int buttonState = digitalRead(buttonPin);
for (int i; i <2; i++)
digitalWrite(ledPin, HIGH);


In your for loop, try initializing i to zero.

Get in the habit of using proper indentations now, before your programs get any longer.

Add after


while(buttonState==HIGH); // add this