Merge pull request #4 from jasnell/stopwatch-update
Stopwatch: beep on button press, reset laptimesmaster
commit
8076430514
|
|
@ -50,6 +50,7 @@ function drawms() {
|
|||
|
||||
setWatch(function() { // Start/stop
|
||||
started = !started;
|
||||
Bangle.beep();
|
||||
if (started)
|
||||
tStart = Date.now()+tStart-tCurrent;
|
||||
tCurrent = Date.now();
|
||||
|
|
@ -69,12 +70,15 @@ setWatch(function() { // Start/stop
|
|||
}, 20);
|
||||
}, BTN2, {repeat:true});
|
||||
setWatch(function() { // Reset
|
||||
Bangle.beep();
|
||||
if (!started) {
|
||||
tStart = tCurrent = Date.now();
|
||||
}
|
||||
lapTimes = [];
|
||||
updateLabels();
|
||||
}, BTN1, {repeat:true});
|
||||
setWatch(function() { // Lap
|
||||
Bangle.beep();
|
||||
if (started) tCurrent = Date.now();
|
||||
lapTimes.unshift(tCurrent-tStart);
|
||||
tStart = tCurrent;
|
||||
|
|
|
|||
Loading…
Reference in New Issue