let lastTime = getTime();
function calcTimeDifference(fix) {
if (!fix.time) return;
var t = getTime();
print(t-lastTime);
lastTime = t;
}
console.log(process.env.VERSION);
Bangle.on("GPS", calcTimeDifference);
Bangle.setGPSPower(1);
NRF.setConnectionInterval(200); // low BLE speed = less GPS interference
Works surprisingly well - because we know the GPS sends data once a second, we just see how many seconds the Bangle thinks have passed. Obviously it'd be better averaging over more seconds though.
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.
Also, thanks for the test code @BartS23!
Thinking about that, I wonder whether something could be added to https://banglejs.com/apps/?id=widadjust to allow it to figure out the drift using GPS.
Even this code:
Works surprisingly well - because we know the GPS sends data once a second, we just see how many seconds the Bangle thinks have passed. Obviously it'd be better averaging over more seconds though.
2v22:
With the fix:
So it's an order of magnitude better