Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement buzzer sounds #7

Open
johnwalicki opened this issue Apr 1, 2021 · 8 comments
Open

Implement buzzer sounds #7

johnwalicki opened this issue Apr 1, 2021 · 8 comments

Comments

@johnwalicki
Copy link
Member

johnwalicki commented Apr 1, 2021

Currently the buzzer will sound an earthquake alert sound if a shake is detected or if the device receives a MQTT message from the regional network declaring an alarm.

Not exactly "music" but we can make the sensor beep different status messages too.

@johnwalicki
Copy link
Member Author

There are a variety of GitHub repositories and tutorials on the Internet which use the Arduino tone() function to play short / crude tunes on the piezo buzzer.
The best repository I found was here: https://github.com/robsoncouto/arduino-songs

@johnwalicki
Copy link
Member Author

The gotcha is that esp-idf does not implement the arduino tone() function
https://esp32.com/viewtopic.php?f=13&t=16839&sid=fe47120147b9794023ba8d59e07c1aa9

@johnwalicki
Copy link
Member Author

@johnwalicki
Copy link
Member Author

The buzzer code is really simplistic.

// Generate Buzzer sounds
void AlarmBuzzer() {
  ledcWrite(channel, 50);
  delay(100);
  ledcWrite(channel, 500);
  delay(100);
  ledcWrite(channel, 2000);
  delay(100);
  ledcWrite(channel, 4000);
  delay(100);
}

@johnwalicki
Copy link
Member Author

If someone wanted to experiment with the buzzer sound, it would be a good hardware issue to tackle.

@johnwalicki
Copy link
Member Author

Do we want to tag this for the v1.5.0 firmware and Caribbean deployment?
We might push this to the backlog if it's not in the critical path.

@neilh10
Copy link

neilh10 commented Apr 1, 2021

What if the audible is tied to the system states, #7 that would define what states need an audible component and keep it integrated with the major visual status. It simplifies testing.

When a device/product is successful it is often because there are user interface components that are configurable - the tones - so potentially (for the future) an extensible framework that could allow tone configuration. (ouch sorry seems like just needs one pleasant sound for the first pass !)

One of the issues with audible is a user "cut-off" ~ "thanks I heard, now turn off".
This was standard requirement for all telecom equipment that had an Infiniti of notifications for the technicians to be alerted.

The cut-off was both messaging, the virtual (MQTT?), and also the physical in front of the device.
Could a "double tap" on the side of the device be detected,(and separated out from earthquake readings) for an audible cutoff.

@andygrillo
Copy link
Member

andygrillo commented Apr 1, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants