Skip to content

Instantly share code, notes, and snippets.

@donly
Last active December 25, 2020 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donly/d648bffeb515b9af6fffe3c3b6c263b8 to your computer and use it in GitHub Desktop.
Save donly/d648bffeb515b9af6fffe3c3b6c263b8 to your computer and use it in GitHub Desktop.
An Arduino sample running with buzzer
#define BUZZER D6
void setup() {
Serial.begin(115200);
Serial.println("setup");
pinMode(BUZZER, OUTPUT);
digitalWrite(BUZZER,HIGH);
}
void loop() {
buzzer_Di();
}
void buzzer_Di() {
Serial.println("Bi..");
digitalWrite(BUZZER,LOW);
delay(300);
digitalWrite(BUZZER,HIGH);
delay(300);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment