define pinBuzzer void setup pinMode pinBuzzer OUTPUT void loop tone pi

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#define pinBuzzer 5
void setup() {
pinMode(pinBuzzer, OUTPUT);
}
void loop() {
tone(pinBuzzer, 500);
delay(1000);
noTone(pinBuzzer);
delay(1000);
}