mirror of https://github.com/espruino/BangleApps
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
parent
caa5629ae3
commit
e76535fece
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue