Skip to content

Instantly share code, notes, and snippets.

@Alqueraf
Created June 11, 2018 16:50
Show Gist options
  • Save Alqueraf/287b0ad1563eb46599a76e8dcfe5c274 to your computer and use it in GitHub Desktop.
Save Alqueraf/287b0ad1563eb46599a76e8dcfe5c274 to your computer and use it in GitHub Desktop.
Simple beeping tone for a buzzer
const int BUZZER = 9
void setup(){
// Marcamos el pin del buzzer en modo salida
pinMode(BUZZER, OUTPUT);
}
void loop(){
// Mandamos señal de 1kHz
tone(buzzer, 1000);
// Durante 1 segundo
delay(1000);
// Silencio
noTone(buzzer);
// Durante 1 segundo
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment