arduino notone

#include <toneAC.h>

const int buzzerPin = 9; // Define the buzzer pin

void setup() {
  noToneAC(buzzerPin); // Turn off any existing tone on the buzzer pin
  pinMode(buzzerPin, OUTPUT); // Set the buzzer pin as an output
}

void loop() {
  // Your main code logic here

  // Example: Generate a 1 kHz tone for 1 second
  toneAC(buzzerPin, 1000, 1000); // Parameters: pin, frequency in Hz, duration in milliseconds

  // Your additional code logic here

  noToneAC(buzzerPin); // Turn off the tone after generating it
  delay(1000); // Wait for 1 second before the next iteration
}