I think something like this will do what you want:
Serial3.setup (115200, {rx: P0, tx: P1});
var lastData;
var gps = require ("GPS"). connect (Serial3, function (data) {
console.log (data);
if (lastData) {
// do stuff here - eg. the difference between the two readings
var dlat = data.lat - lastData.lat;
var dlon = data.lon - lastData.lon;
}
lastData = data;
});
Although as you say, you might be able to extract the data that you want from other NMEA data. For instance VTG - Velocity made good sounds promising
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.
I think something like this will do what you want:
Although as you say, you might be able to extract the data that you want from other NMEA data. For instance
VTG
-Velocity made good
sounds promising