Update stopwatch.js

-Swapped functions of BN1 and BN3
pull/152/head
Red-The-Hunter 2020-03-28 12:12:22 +08:00 committed by GitHub
parent 72d0de30a5
commit be539e5993
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 10 deletions

View File

@ -18,8 +18,8 @@ function updateLabels() {
g.setFont("6x8",2);
g.setFontAlign(0,0,3);
g.drawString(started?"STOP":"GO",230,120);
if (!started) g.drawString("RESET",230,50);
g.drawString(started?"LAP":"SAVE",230,190);
if (!started) g.drawString("RESET",230,190);
g.drawString(started?"LAP":"SAVE",230,50);
g.setFont("6x8",1);
g.setFontAlign(-1,-1);
for (var i in lapTimes) {
@ -78,14 +78,6 @@ setWatch(function() { // Start/stop
drawms();
}, 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();
@ -98,6 +90,14 @@ setWatch(function() { // Lap
require("Storage").writeJSON("StpWch-"+timenow.toString(), saveTimes);
}
updateLabels();
}, BTN1, {repeat:true});
setWatch(function() { // Reset
Bangle.beep();
if (!started) {
tStart = tCurrent = Date.now();
}
lapTimes = [];
updateLabels();
}, BTN3, {repeat:true});
updateLabels();