Skip to content

Instantly share code, notes, and snippets.

@schappim
Created June 5, 2018 03:57
Show Gist options
  • Save schappim/136b056448d280f880eee2860378727c to your computer and use it in GitHub Desktop.
Save schappim/136b056448d280f880eee2860378727c to your computer and use it in GitHub Desktop.
const int buzzer = 9; //buzzer to arduino pin 9
void setup() {
pinMode(buzzer, OUTPUT); // Set buzzer - pin 9 as an output
}
void loop() {
tone(buzzer, 1000);
delay(1000); // on for 1 sec
noTone(buzzer); // Stop sound
delay(1000); // on for 1sec
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment