touchtimer: ADD 5 second count down buzzer

- This is a configurable option (Default is off) for the timer to buzz
  each second when there are 5 seconds left.
pull/1610/head
Brendan Hubble 2022-03-23 18:44:01 +11:00
parent caa5629ae3
commit e76535fece
4 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,4 @@
0.01: Initial creation of the touch timer app
0.02: Add settings menu
0.03: Add ability to repeat last timer
0.04: Add 5 second count down buzzer

View File

@ -126,6 +126,14 @@ var main = () => {
timerIntervalId = setInterval(() => {
timerCountDown.draw();
// Buzz lightly when there are less then 5 seconds left
if (settings.countDownBuzz) {
var remainingSeconds = timerCountDown.getAdjustedTime().seconds;
if (remainingSeconds <= 5 && remainingSeconds > 0) {
Bangle.buzz();
}
}
if (timerCountDown.isFinished()) {
buttonStartPause.value = "FINISHED!";
buttonStartPause.draw();

View File

@ -2,7 +2,7 @@
"id": "touchtimer",
"name": "Touch Timer",
"shortName": "Touch Timer",
"version": "0.03",
"version": "0.04",
"description": "Quickly and easily create a timer with touch-only input. The time can be easily set with a number pad.",
"icon": "app.png",
"tags": "tools",

View File

@ -31,6 +31,14 @@
writeSettings(settings);
},
},
"CountDown Buzz": {
value: !!settings.countDownBuzz,
format: value => value?"On":"Off",
onchange: (value) => {
settings.countDownBuzz = value;
writeSettings(settings);
},
},
"Pause Between": {
value: settings.pauseBetween,
min: 1,