The code below takes out the checks mentioned above. The watch (Dozenal Time 2 on Bangle.js 2) still gains 4+ seconds a day. (Bangle.js 1 does not.)
Can it be determined from this whether it is reading GPS time, continually? Must the GPS be acquired and set before the watch face is uploaded? The reverse? Does it matter?
I apologize once again for not being a scripter. Most of the rest of the watch code was written by a person who left the project. A little of the most obvious javascript I understand, but that's all.
// Time fix with GPS
function fixTime() {
Bangle.on("GPS",function cb(g) {
Bangle.setGPSPower(0,"time");
Bangle.removeListener("GPS",cb);
// We have a GPS time. Set time
setTime(g.time.getTime()/1000);
}
);
Bangle.setGPSPower(1,"time");
setTimeout(fixTime, 10*60*1000); // every 10 minutes
}
// Start time fixing with GPS on next 10 minute interval
setTimeout(fixTime, ((60-(new Date()).getMinutes()) % 10) * 60 * 1000);
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The code below takes out the checks mentioned above. The watch (Dozenal Time 2 on Bangle.js 2) still gains 4+ seconds a day. (Bangle.js 1 does not.)
Can it be determined from this whether it is reading GPS time, continually? Must the GPS be acquired and set before the watch face is uploaded? The reverse? Does it matter?
I apologize once again for not being a scripter. Most of the rest of the watch code was written by a person who left the project. A little of the most obvious javascript I understand, but that's all.