mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-13 03:19:04 +08:00
Update buzzer.cpp
This commit is contained in:
parent
4961ff9902
commit
7bc15e1bd9
@ -80,6 +80,7 @@ void BuzzerDevice::end()
|
|||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
ledcDetachPin(ESP3D_BUZZER_PIN);
|
ledcDetachPin(ESP3D_BUZZER_PIN);
|
||||||
#endif //ARDUINO_ARCH_ESP32
|
#endif //ARDUINO_ARCH_ESP32
|
||||||
|
no_tone();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -90,6 +91,7 @@ void BuzzerDevice::handle()
|
|||||||
|
|
||||||
void BuzzerDevice::beep(int count, int delay, int frequency)
|
void BuzzerDevice::beep(int count, int delay, int frequency)
|
||||||
{
|
{
|
||||||
|
if (_started) {
|
||||||
while (count > 0) {
|
while (count > 0) {
|
||||||
playsound(frequency,BEEP_DURATION);
|
playsound(frequency,BEEP_DURATION);
|
||||||
if (delay > 0 ) {
|
if (delay > 0 ) {
|
||||||
@ -98,6 +100,7 @@ void BuzzerDevice::beep(int count, int delay, int frequency)
|
|||||||
waitWhilePlaying();
|
waitWhilePlaying();
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuzzerDevice::no_tone()
|
void BuzzerDevice::no_tone()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user