byte BUZZ_PIN = 2;
void setup() { pinMode(2, OUTPUT); }
void loop() { // Fire alarm beep pattern
for(byte i=0; i<2; i++) // Из wowki bomb
{ tone(BUZZ_PIN,880); delay(40); //a5
tone(BUZZ_PIN,988); delay(40); //b5
tone(BUZZ_PIN,523); delay(40); //c5
tone(BUZZ_PIN,988); delay(40);
tone(BUZZ_PIN,523); delay(40);
tone(BUZZ_PIN,587); delay(40); //d5
tone(BUZZ_PIN,523); delay(40);
tone(BUZZ_PIN,587); delay(40);
tone(BUZZ_PIN,659); delay(40); //e5
tone(BUZZ_PIN,587); delay(40);
tone(BUZZ_PIN,659); delay(40);
tone(BUZZ_PIN,659); delay(40); }
}
/* code generates random tones for DURATION between +300 and -300 of f specified
int freq, duration;
int low = freq - 300;
int high = freq + 300;
unsigned long time = millis();
while(millis() - time <= duration) {
tone(2, random(low, high)); } //delay(100);
noTone(2); } */
//----------------------------------------------------------------------
/*void loop() { // Fire alarm beep pattern
for (int i = 0; i < 3; i++) { // Repeat the beep three times
tone(LED_BUILTIN, 3000, 200); // High-pitched beep at 3000 Hz for 200 milliseconds
delay(200); }// Short delay between beeps
delay(1000); // Longer delay before repeating the pattern
} */