Skip to content

Instantly share code, notes, and snippets.

@maliqq
Last active March 13, 2026 00:10
Show Gist options
  • Select an option

  • Save maliqq/0144b66ebf203bf0c79f62cc18649990 to your computer and use it in GitHub Desktop.

Select an option

Save maliqq/0144b66ebf203bf0c79f62cc18649990 to your computer and use it in GitHub Desktop.
const int buzzerPin = 9; // Assign the buzzer to digital pin 9
void setup() {
pinMode(buzzerPin, OUTPUT); // Set the buzzer pin as an output
}
void loop() {
tone(buzzerPin, 1000); // Send a 1KHz sound signal
delay(1000); // Pause for 1 second
noTone(buzzerPin); // Stop the sound signal
delay(1000); // Pause for another 1 second
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment