kalashas:
i have passive not active buzzer. So i need help to improve my main code with tone code for buzzer.
You need to understand how your buzzer works in electrical terms - what input does it need in order to make the noise you want? Perhaps it just needs a 0-5V square wave of the appropriate frequency and less than 20mA. In that case I suggest you start with a test sketch that just drives the buzzer with the right frequency and get that working before you try to add that capability back into your original sketch. Perhaps you will find the tone() function useful for that.