@Gordon would it be possible to get a module interface to the GPSrec App/Widget.
I have just written some code to allow me to turn the recorder on / off through the gps watch face (Kitchen Combo) on a long BTN2 press. When the logger is off I can turn the GPS on through the gps face of kicthen combo. When I turn the logging on the widget will start to flash showing that logging is taking place. But when I turn the logger off through the code - it also turns the GPS off. What I need is a logging off but leave GPS on interface.
This is the code I have used at the moment.
GPS.prototype.toggleGpsLogging = function() {
var settings = require("Storage").readJSON("gpsrec.json",1)||{};
if (settings == {}) return false;
settings.recording = !settings.recording;
require("Storage").write("gpsrec.json", settings);
if (WIDGETS["gpsrec"])
WIDGETS["gpsrec"].reload();
return true;
}
GPS.prototype.loggingStatus = function() {
var settings = require("Storage").readJSON("gpsrec.json",1)||{};
if (settings == {}) return "E-LOG";
if (settings.recording) return "ON";
return "OFF";
}
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.
@Gordon would it be possible to get a module interface to the GPSrec App/Widget.
I have just written some code to allow me to turn the recorder on / off through the gps watch face (Kitchen Combo) on a long BTN2 press. When the logger is off I can turn the GPS on through the gps face of kicthen combo. When I turn the logging on the widget will start to flash showing that logging is taking place. But when I turn the logger off through the code - it also turns the GPS off. What I need is a logging off but leave GPS on interface.
This is the code I have used at the moment.