Arduino buzzer code sequence not triggering I have a problem with my arduino buzzer:
the code should be doing the following:
I have a security system where in order to open the door you have to enter a 4 digit code from the remote. If the code is correct the door opens. if not you can try again.
You have 3 chances to try to enter the pin before an alarm goes on. here comes the problem: the alarms code triggers but the buzzer isn't making any sound.
here is the code for the alarm sound:
if (tryCount&gt;=3) { // if the pin is wrong 3 times we sound an alarm
    Serial.println(&quot;got in alarm&quot;);
    while(true) {
        Serial.println(&quot;got in while&quot;);
        noTone(buzzer);
        tone(buzzer,100,300);
        delay(300);
        noTone(buzzer);
        tone(buzzer,1000,300);
        delay(300);
    }
}

here is the proof the alarm code triggers:

here is the full code:
https://create.arduino.cc/editor/mihimbc/8ec2fe30-d812-45cc-b0ae-850b437eb05b/preview
and here is the hardware schematics:
The problem was with the buzzer, somehow was a faulty buzzer, I've managed to replace it and the problem was solved.
Thanks everybody for your time trying to help me!