Option for Buzzer #39
electric-m
started this conversation in
Ideas
Replies: 1 comment 4 replies
-
Maybe something like this? void loop() {
// Read the state of the button value:
buttonState = digitalRead(buttonPin);
// Check if the button is pressed.
// If it is, the buttonState is LOW (because of INPUT_PULLUP) :
if (buttonState == LOW) E
// Buzz the butzer 5 times
for (int i = 0; i < 5; i++) {
digitalwrite(buzzerPin, HIGH); - //- Turn the Buzzer on delay (300);
// wait for half a second
digitalWrite(buzzerPin, LOW);
// Turn the Buzzer off
delay(300);
// Wait for half a second
}
// Wait for the button to be released
while (digitalRead(buttonPin) == LOW) {
delay(30);
// Little delay for debounce
}
} |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there,
I was wondering if it would be possible to add code for using a buzzer at the ESP32.
Something like defining pins, make them configurable in config.h
When a tag is presented, the buzzer should output something like „beep beep“.
michael
Beta Was this translation helpful? Give feedback.
All reactions